StyleCop for ReSharper 5.1.14986.0000 Available
There have been a few new releases of StyleCop for ReSharper in the last 2 weeks – I have been trying to track down and fix some of the more gnarly long standing bugs that have haunted this product – the two big ones are performance and memory usage. I’ve managed to make significant improvements in both areas by implementing some caching around intensive and repetitive operations, such as finding, loading and parsing stylecop settings files and also caching instances of internal objects that are expensive to create (both in terms of CPU cycles and I/O hits).
When approaching bits of performance tuning, I work like this: the general approach I take is to put input / output trace-logging on all methods – this gives you a true picture of the application’s execution stack – the amount of calls it has to make to do something. Next I perform an operation in the application that will cause the code being monitored to execute, and then copy and paste the tracelog generated into Notepad++ and use the nesting of the log entries to see which methods are doing the most work and which methods are called the most times. These are the first two indicators of where your effort should go. Next apply caching, re-perform the operation, paste debug output into a new window and count how many less lines of output have been generated. It’s a very crude method – but work very well.
Before I started this exercise, StyleCop for ReSharper would generate something like 220 lines of debug output per keystroke within Visual Studio, this included 10s of I/O operations and expensive object creation. After doing the performance tuning spike this went down to less than 30 lines of debug output with no I/O and no expensive object creation.
The upside is that the feeling of “lag” you get while typing has gone and also the amount of managed memory used inside ReSharper does not balloon as it always has before. You should now be able to do a whole days coding without noticing any significant performance degradation.
As always you can find the latest release at: http://stylecopforresharper.codeplex.com/
About this entry
You’re currently reading “StyleCop for ReSharper 5.1.14986.0000 Available,” an entry on Howard van Rooijen's Blog
- Published:
- January 12, 2011 / 11:09 am
- Category:
- StyleCop for ReSharper
- Tags:
1 Comment
Jump to comment form | comment rss [?] | trackback uri [?]