Template Caching

The Standard Edition of CodeSmith compiles your templates each time your execute them. The Professional Edition streamlines this process in many circumstances by using template caching. If the template's content and dependencies have not changed, CodeSmith is able to use the already compiled assembly to render the template's output, rather than recompiling the template.

For CodeSmith to be able to use template caching, the template must be unchanged since the last time it was compiled. To determine this, CodeSmith checks the source code of the template for changes, and also recurses into any templates and source files referenced through Assembly or Register directives.

Template caching makes a big difference in the performance of CodeSmith when you're repeatedly executing the same template without modifying the template itself. You'll see a nice performance boost when you just execute a template (the Properties window will open more quickly), but the real benefit comes when you integrate CodeSmith into your build process. With template caching, using CodeSmith through the batch generation process or CodeSmith Console Application is substantially faster.

This feature is only available in the Professional Edition of CodeSmith.