Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#291 Limit exception when registering types

closed-rejected
nobody
None
5
2008-10-10
2008-10-10
Lionel
No

The TypeRegistry.RegisterTypesFromAssembly throw quite a couple of exceptions (even if they are caught). Since there are a few ever-present assemblies for which exceptions are always thrown, I suggest to explicitly ignore them (rather than relying on exceptions being caught : better design + exception catching is slow).

For instance:

// A recurring kind of dynamic assembly - this way, we avoid going into the (slow) catch below.
if (a.FullName.StartsWith("System.Xml.Xsl.CompiledQuery"))
return;

Discussion

  • John Davidson
    John Davidson
    2008-10-10

    • status: open --> closed-rejected
     
  • John Davidson
    John Davidson
    2008-10-10

    The recommended fix is rejected as it processes slower than allowing the exception. I did 3 runs of the unit tests (~1000 cases) with and without the fix. In all cases the original code without the fix was faster by 1 second with normal times of 81.9 secs without the fix and 82.7 sec with the fix.

    Caught exception catching is faster now than it was in the past.