Hi,
In something that can only be described as a week-long coding frenzy I
rewrote PEG.js code generator. The goals of the rewrite were:
1. Allow optimizing the generated parser code for code size as well as
for parsing speed.
2. Prepare ground for future optimizations and big features (like
incremental parsing).
2. Replace the old template-based code-generation system with
something more lightweight and flexible.
4. General code cleanup (structure, style, variable names, ...).
The most important change from user POV is that the new generator
allows optimizing for parsing speed or code size. You
can choose using the |optimize| option of the |PEG.buildParser| method
or the --optimize/-o option on the command-line.
The rewrite also improved parsing speed and parser code size
significantly. The generated parsers are now:
* 39% faster when optimizing for speed
* 69% smaller when optimizing for size (without minification)
* 31% smaller when optimizing for size (with minification)
See the commit message for all the details:
http://bit.ly/UBpoty
Please note this is just a beginning! The new code generator lays a
foundation upon which many optimizations and improvements can (and
will) be made in the future. So stay tuned :-)
--
David Majda
Entropy fighter
http://majda.cz/