当前位置: 动力学知识库 > 问答 > 编程问答 >

java - Why does Guice's injector.getInstance() take so long?

问题描述:

My Java desktop application uses Google Guice for dependency injection. So far everything is good, however the app takes a long time to start up. I put in some timing logs into the code and found the line that is taking a long time:

this.applicationRunner = injector.getInstance(ApplicationRunner.class);

On average this takes around 45 seconds to complete.

My app uses javax.inject in combination Guice and it's standard features (Providers, Named parameters, etc.)

How could I find out why this is taking so long?

分享给朋友:
您可能感兴趣的文章:
随机阅读: