Revision 126, the first post 2.0.2 check-in, adds an exciting change to the core template engine which will improve the overall usability of SubSonic. I'll get to that in a minute, but first there are a couple more mundane changes that I'd like to mention.
The first of these fixes an issue in 2.0.2 regarding logical deletes. Andrew Rimmer pointed an issue that was introduce with the switch to treat null values as false when handling the special columns. I think that this only represents an issue if your these columns are actually defined as nullable, but please check your results carefully if using this functionality.
The second set of changes are some tweaks to help support the use of SubSonic in medium trust environments. Specifically, these are:
- A small modification to the SubSonic AssemblyInfo.cs which was marked as requiring permissions beyond those available in medium trust scenarios.
- A change in the tracing behavior. By default, SubSonic tracing is now disabled. Not only does this address medium trust issues, it eliminates a degree of unnecessary overhead in production environments. Tracing can be enabled or disabled across all providers via new service (not provider) level boolean parameter switch, traceEnabled
However, the cool addition in Revision 126 is the newly rewritten template execution engine. The new engine is designed at every turn to eliminate expensive or redundant operations and minimize the number of times the compiler is invoked. Rather than generating the final code by compiling an assembly for each template executed, all templates compiled into a single assembly.
The results are dramatic, in the neighborhood of an 800% improvement. For example, in my environment, the time to generate the code for the default configuration scenario (two providers using the Northwind database), the execution time dropped from 17 seconds to 2.
While this means that you can generate your classes faster, the real benefit is when using the build provider, as it dramatically reduces the time required to compile your project, and eliminate the extended IDE lockup that occurs when performing actions that trigger the build provider, such as editing web.config.
Does it feel faster? Let us know!