Jump to navigation

Poupou's Corner of the Web

Looking for perfect security? Try a wireless brick.
Otherwise you may find some unperfect stuff here...

Weblog

There are still great GSoC opportunities left!

but a little story first...

A few weeks ago I wanted to optimize, i.e. turn off, some Gendarme rules based on whether a module holds, or not, a member reference to some method. In doing so I needed to compare a lot of MemberReference but it turns out that they are re-computed (either with String.Concat or StringBuilder) each time.

I suspected this was slowing down Gendarme a bit and would even more with the change I had in mind. My first reflex was suggesting to JB to cache those values inside Cecil. He reminded me that since Cecil can write assemblies (a fact I'm quick to forget ;-) caching those value is not simple.

Nevertheless I had some ideas to try. But before trying anything I decided to create a baseline, i.e. how much memory Gendarme allocated to analyze all of Mono's 2.0 assemblies (805573 KB). The next logical step was to see how much my idea would save (or not) but I got curious and looked into my baseline log file...

It was not long before I found some stuff that looked out of the ordinary. From unrequired boxing in struct operators (about 3MB) in Cecil and a lot of (avoidable) MonoType.ToString (about 16MB) inside Gendarme. At that stage I had forgotten my original idea and continued looking at the biggest allocations going on... to the point where I found that reusing Hashtable inside ReadCilBody could save, alone, 10% of the allocated memory.

Final score: 686069 KB, so 15% less memory needs to be allocated (and tracked and freed). Since all, but one, changes are inside Cecil a lot of applications should benefit from them (at least once they update from SVN or when the next Mono version is released). The only negative aspect is that I still don't know if my idea was good or not ;-(

back to our original subject...

The funny things is that this blog is very typical. Optimizations, either for higher performance or lowering memory requirements, are common and often blogged about (probably since the results are easily expressed in numbers). It's also the most replied to subject in the mailing-list too.

So I find it strange to there has not been any GSoC proposal for those projects:
Summer of Profiling
Gendarme: Statistics and Performance Analysis
or any other similar proposal from students - as there are many ways to "articulate" such a proposal.

If I could save 15% on a weekend how much could you save in a summer ?


3/31/2008 10:13:00 | Comments | Permalink

Gendarme News

A lot of cools things around Gendarme are happening and I've fallen behind in blogging them :-(

Nestor has been working on a NAnt task (see old screencast). He's also planning something very cool... but I'll let him announce it - even if it's not hard to find out what it is ;-)

Dan has updated his unit test helpers (from GHOP) to match the recent Gendarme framework changes. This is very exciting since writing tests, generally, is not. So Dan's goal was to make it easier/faster to create them. Even so converting old tests is not much fun so I wrote a new rule this weekend: OverrideValueTypeDefaultsRule to get a chance to try Dan's code for myself. The result speaks for itself: it's smaller (source wise) and yet makes it easier to get full coverage. It will also be faster (when used for more than one rule ;-) since it cache AssemblyDefinition between fixtures. Mission accomplished Dan!

Andy noticed we don't ship mono-tools for Windows, which means there's no easy way to install Gendarme on Windows. This prompted me to finish something I tried during the last hackweek: a win32 installer for Gendarme.

I had the feeling that providing an installer for a console-based tool was an overkill. The easy solution was to include a GUI as part of the package.

Right now the wizard runner has some problems with Mono's Managed Windows Forms (some of them may be due to my lack of SWF knowledge) but I expect them to be fixed before before Mono 2.0 is released ;-). Testers, on every platform, are welcome!

Speaking of GUI Ben Mothman has started a MonoDevelop addin for Code Analysis and Dan has already started helping him. I'm looking forward to seeing this addin available :-)

Finally GSoC 2008 is already here. Last year I mentored four projects, three of them specific to Gendarme. Mono is still a mentoring organization this year and has published a list of ideas including some about Gendarme. Of course your own ideas are welcomed too. Come talk to us on #gendarme (gimpnet) if you have any interest to propose a Gendarme related project!

Hopefully I did not forgot too much stuff, or people, in this entry. If so I'll try to amend next time ;-)


3/24/2008 20:04:53 | Comments | Permalink

Silverlight 2.0 beta1

It's released. Now with new assembly names, version and public keys ;-)


most of the stuff


the lone vb stuff


3/5/2008 16:15:33 | Comments | Permalink

The views expressed on this website/weblog are mine alone and do not necessarily reflect the views of my employer.