How can I improve Windsor 3.0 startup time?

283 Views Asked by At

I am trying out Windsor 3.0 to see if we can upgrade.

The following console application

var t = DateTime.Now;
var container = new WindsorContainer();
Debug.WriteLine("Created in " + (DateTime.Now - t).TotalMilliseconds);

Takes 5421.875ms (consistently above 5000ms) to create the WindsorContainer.

Any suggestions to decrease this creation time?

2

There are 2 best solutions below

0
On BEST ANSWER

The source of this behaviour is initialisation of performance counters.

Starting with beta 2 (currently in trunk) performance counters will be off by default so that performance hit should go away.

4
On

How can I improve Windsor 3.0 performance?

In this case:

  • Make sure you have the PDBs of Castle.Windsor and Castle.Core
  • Get the sources.
  • Put a breakpoint in the instantiation of WindsorContainer
  • Debug it step by step until you find the source of the issue.
  • Fix the issue
  • Submit a pull request.

Or use some profiler like dotTrace to find the cause.