tags:

views:

153

answers:

1

I have a console application that uses Unity. In the app.config, I have 20 or so types registered in the default container.

I find that starting up the application (until I start to see some initial output) is very slow compared to a console application built without Unity.

Is there anyway I can improve this start up time?

A: 

It is always worth taking measurements to track down the source of performance problems. Try using the StopWatch class or a profiling tool to help you find what is taking the time. Is it the time taken to load your config? Is it the time to Resolve the first class?

Mark Heath
Hi,Resolution speed is fine. It's the initial time to load up the application that is slow.To give an example, I created a shell console application that does not reference any of the Unity assemblies and the first line in the Main method is hit almost immediately.However, if I have an application that does use Unity, then it can take up 10 seconds before the first line is hit. Note, this is even before the call is made to configure the container.
Long Pham