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...


Gendarme Performance

Most of the recent Gendarme framework API changes were made to simplify writing rule and/or make them easier to read (and review). However some also had slight motivations to help performance, either by reducing memory allocations or by reducing the number of times a rule needs to be called.

So, with those changes, I anticipated slightly better performance from the previous version. Running the default rule set of Mono's mscorlib.dll 2.0 takes:

  • 56.881992 seconds for (the version that will ship with Mono 1.9); and
  • 55.303419 seconds for (SVN HEAD).

Not a big, or even significant, difference. However has seven (7) more rules than 0.0.5 and also loads debugging information (mdb for Mono) to report source files and line numbers for defects. So, considering the extra work, it seems we negated the impact of those new features.

Another new feature, the AssemblyResolver can also takes a big toll since it will likely load all referenced assemblies. This doesn't show on the previous results (on purpose) since mscorlib.dll doesn't reference any other assembly. However almost all other existing assemblies have references.

So to see the impact on a large code base, I executed the default set on the 70 assemblies provided by Mono's 2.0 profiles. Results are:

  • 422.813083 seconds for
  • 441.197703 seconds for

So a bit more time than before. Yet this is still very approximate since some rules don't yet take fully advantages of the API changes. E.g. rules are now able to turn themselves off if they can't be used (e.g. checking for a 2.0 specific problem on a 1.x assembly). Another example, where more time would be required, is that rules can now work on the assembly set (find problem across several assemblies) and not just on individual assemblies.

If any of this got your interest then there might be a student task waiting for someone like you!

2/20/2008 23:04:40 | Comments | Permalink

Novell Hack Week - Gendarme Results

Here's an unsorted list of stuff from last week. It's short on details but I'll try to blog about some specific new features this week. Also big thanks to Nestor and JB for their code, help and advice all week long!

  • Makefiles now generate monodoc documentation for the framework
  • VS.NET solution/project file(s) updated (now requires VS.NET 2008 since Gendarme uses C# 3 features)
  • Framework API changes that allows
    • Removing requirements of Gendarme.Rules.*.xml[.in] files
    • Added runner events and rule Initialize / Active for performance
    • MessageType.[Warning|Error] has been split into Severity and Confidence
    • Removing temporary collections and book-keeping from rules
    • Added support for JB's AssemblyResolver. Rules can now go deeper in their analysis
  • Use debugging information to show offending source line for both Mono (mdb) and MS.NET (pdb)
  • All existing rules updated to the new API
  • 4 new rules for Gendarme.Rules.Serialization (new category/assembly)
  • Rework console runner to use Jonathan Pryor's NDesk.Options.
  • Support for ignore list(s) in runners

Finally a lot of misc stuff and bits where done while converting rules (it's a lot funnier to refactor with a good test suite). Also some other stuff were started (but not completed) and lots of new idea were filled (in my Tomboy notes) so expect more surprises at a later date ;-)

2/18/2008 13:11:28 | Comments | Permalink

Novell Hack Week

Next week is the second Novell Hack Week. This time I'll be hacking on Gendarme to add some stuff we've been talking for so long. I'm glad that Nestor has completed his exams and back hacking, at full speed, on Gendarme! If you want to give an hand then come see us on #gendarme (GIMPNet) or drop us an email on our Google Group.

But let's not forget this week where three new rules were added to SVN.



More news next week!

2/7/2008 23:52:48 | Comments | Permalink

Morning (and caffeine-free) surprises

I didn't feel well this morning. My stomach was punishing me for something (I wish I knew what). However my moral was soon up when I found out a new Gendarme rule (with unit tests) in my mailbox. Thanks to Scott Peterson for joining the select group of Gendarme hackers and for making me forget about my stomach - at least for a few minutes :)

2/5/2008 13:13:30 | Comments | Permalink

Gendarme 0.0.5 - part II

What? Missed the first part ? Quick here it is!

Note that 0.0.5 is the last source-only release of Gendarme - but this isn't a sad news. Gendarme has moved, svn-wise, into mono-tools. This means it will be released with each new Mono release and that every distro that packages mono-tools (or that openSUSE build service supports) will provide Gendarme to it's users.

And here are the other new rules in this release:


2/4/2008 08:33:27 | Comments | Permalink

Gendarme 0.0.5

Now that GHOP is over it's time for another Gendarme release [source tarball].

Major highlights:

  • Includes the 40 rules developed during the GHOP and also 7 more rules by other contributors.
  • Gendarme.Framework.Rocks: A new namespace, inside gendarme's framework, introduce several extensions methods to ease rule creation and avoid code duplication.
  • Updated rules to be more friendly toward C# 3 code (e.g. auto-implemented properties)
  • Lot of enhancements to existing rules to reduce false-positives. Even with all the new rules the number of false-positives is lower than before and Gendarme's self-test looks even better!

It would be too long to list all the new rules in this post, but it would be a shame not to list them too, so here's the first part:


Gendarme.Rules.Interoperability (new)

2/1/2008 13:21:53 | Comments | Permalink

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