Oct 26, 2012 at 8:17 AM
Edited Oct 26, 2012 at 9:41 AM
We've started to roll out NuGet in our company rather successfully. The only trouble we have is the solution wide update experience which is absolutely catastrophic. When running a solution wide update through powershell using:
We had to wait about 35 minutes for the process to complete when all of the base packages were updated. Even for smaller updates we are talking about 12 minutes time. This is just not acceptable.
Since I already dug a bit through the NuGet source code, I started to look at the places where some optimizations could be made. I've found very interesting spots, and achieved a significant performance boost: 10x ! Got down from 12 minutes to 1 minute 20
seconds in the smallest case I used for the tests.
Here are the big lines of what I did:
- Add package dependency caching
- Add command scope package resolution cache
- Found out that AddBindRedirect costs 20% of the time !! I havent found a good improvement yet
- Adding references through the IVsProjectSystem is very very slow ! Changing this to use the MsBuild project interface brings a huge improvement
- EndBatchEdit costs a lot -> moving the EndBatchEdit on a much higher scope (command scope) cut's down the update time by 2 !!
- The VSProject property UniqueName access is horribly slow !!! There must be a better way to manage that
I need to clean up the modifications I made a bit, before I can show some code to discuss this further.