next up previous
Next: Research Issues Up: Compilation of ASF+SDF to Previous: Run-time view

Measurements

In Table 1 we give some measurements for the compilation of four large ASF+SDF specifications: compiler (the ASF+SDF compiler itself), parser generator (a GLR parser generator), COBOL formatter (a generated formatter for the COBOL language), and Risla flattener (a domain-specific language, explained in more detail below).

For each specification we give the number of equations, the number of lines of ASF+SDF specification without comments, the number of lines of generated C code, the time needed by the ASF+SDF compiler to generate C code, and finally the time it took the C compiler (using the -O optimization option) to compile the generated code. We prefer the native cc compiler since it optimizes tail recursion, which is not the case for gcc and this yields a better performance in some cases. Measurements were performed on an ULTRA SPARC-IIi (300 MHz) with 576 Mb of memory. We are currently preparing detailed benchmarks comparing the efficiency of ASF+SDF with that of other, related, formalisms [14].


Table 1: Measurements of the ASF+SDF compiler.
Specification Nr of Lines of Lines of ASF+SDF C
  eqs ASF+SDF C code compiler compiler
Compiler 1748 7972 75578 186 s 263 s
Parser generator 1365 4586 49649 203 s 168 s
COBOL formatter 1857 8387 76788 371 s 339 s
Risla flattener 1258 16453 76664 324 s 759 s


We now further explain the Risla flattener. Risla is a domain-specific language for specifying financial products developed by Cap Gemini in cooperation with MeesPierson (a Dutch business bank) and CWI and UvA [2,20].

The syntax and semantics of the Risla language have been developed using ASF+SDF. Several years after the initial design, the language was extended with modular constructs yielding the new language Modular Risla. Since there was already a compiler that generated COBOL from the original Risla language, Modular Risla is translated (``flattened'') to original, non-modular, Risla. Both Modular Risla and the flattener have been specified in ASF+SDF using the ASF+SDF Meta-Environment. The result is a Modular Risla programming environment.

Unfortunately, flattening large Modular Risla specifications took much time (about 40 minutes CPU time for an average Modular Risla specification and several hours for large ones) because the ASF+SDF specification defining the flattener is executed by an interpreter in the ASF+SDF Meta-Environment. The new ASF+SDF compiler was then used to compile the Risla flattener to a stand-alone C program. Cap Gemini incorporated this stand-alone C code within the original Risla compiler. The 40 minutes CPU time mentioned above reduce to about 30 seconds when using the generated stand-alone C code.


next up previous
Next: Research Issues Up: Compilation of ASF+SDF to Previous: Run-time view
Paul Klint 2001-06-12