Project Code Generator Performance
Context:
Our customer had built a large code generator based on data models specified in XML with a special-purpose DTD. The code generator consists of a front-end and pluggable back-ends written in Java, and a complex Makefile system for the control of code generation, compilation, archivation, and packaging.
Problem:
The system worked flawlessly in test scenarios, but the generation for real-world data models took several hours.
Solution:
An anlaysis of the complete generation framework showed that the code generator itself as well as the Makefile-based production environment were executed completely sequential. As there were many different back-ends and several phases of the generation process, there was a high potential for concurrency.
Refactoring of the makefile system together with the introduction of threads for generator back-end plugins reduced the overall execution time from hours to minutes on the production system, which is a multi-processor machine running Solaris.


