I am writing an RCP application in eclipse. When I load my application my application models are loaded from a file in the disk and injected with context.
我在eclipse中写了一个RCP应用程序。当我加载我的应用程序时,我的应用程序模型从磁盘中的文件加载并注入上下文。
Using a profiler I noticed that the inject
method slows me down...
使用分析器我发现注入方法减慢了我的速度......
Is this a known issue?
这是一个已知的问题?
Thanks
1 个解决方案
#1
The short answer is no they aren't slow.
简短的回答是不是他们不慢。
The first injection of a class which is not already in the context may mean that the class has to be constructed but this is no slower than normal class construction.
第一次注入一个尚未在上下文中的类可能意味着必须构造类,但这并不比正常的类构造慢。
I have nearly 800 @Inject
statements in one of my RCPs and this does not cause any problems.
我的一个RCP中有近800个@Inject语句,这不会导致任何问题。
#1
The short answer is no they aren't slow.
简短的回答是不是他们不慢。
The first injection of a class which is not already in the context may mean that the class has to be constructed but this is no slower than normal class construction.
第一次注入一个尚未在上下文中的类可能意味着必须构造类,但这并不比正常的类构造慢。
I have nearly 800 @Inject
statements in one of my RCPs and this does not cause any problems.
我的一个RCP中有近800个@Inject语句,这不会导致任何问题。