开发者

Pre-instantiate prototypes in spring.net

开发者 https://www.devze.com 2023-03-25 00:05 出处:网络
Context: I have a set of View/Presenters and I\'ve notice开发者_如何学运维d that for complex views I get some performance issues at the time of the InitializeComponent() call

Context: I have a set of View/Presenters and I've notice开发者_如何学运维d that for complex views I get some performance issues at the time of the InitializeComponent() call

Is there any way to instruct the spring container to pre-instantiate objects scoped as prototype? Something similar to a queue with the objects ready when the application requests them?


We had exactly the same problem. We also found that this performance overhead occured only the first time we requested a form from the container. We didn't find a clean solution, so we decided to write an initialization routine that runs in the background and requests all objects of type Form from the container. When this routine is finished, all forms open quickly.

Looking forward to a better sution, but this worked for us. Main disadvantage of this workaround is, that during the initialization routine, users might still experience some slow loading forms.

0

精彩评论

暂无评论...
验证码 换一张
取 消