You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
David Majda 5b3321d302 Implement |cache| option for |PEG.buildParser|
This option enables/disables the results cache in generated parsers.
Until now, it was always enabled, but after this commit it needs to be
enabled explicitly (i.e. the |cache| option default value is |false|).
The reason is that parsing without it is *much* faster according to the
benchmark.

Note that disabling the cache breaks the linear parsing time guarantee,
meaning that with some grammars you can get exponential parsing time
with respect to the input length. This, together with the possibility of
improving the cache performance in the future, is the reason to keep it
as an option.

Speed impact
------------
Before:     214.08 kB/s
After:      827.52 kB/s
Difference: 286.54%

Size impact
-----------
Before:     1045396 b
After:      949783 b
Difference: -9.15%

(Measured by /tools/impact with Node.js v0.6.6 on x86_64 GNU/Linux.)
12 years ago
..
compiler.js Allow passing options to |PEG.buildParser| 12 years ago
emitter.js Implement |cache| option for |PEG.buildParser| 12 years ago
parser.js Add a hack to skip last comma in |parseFunctions| 12 years ago
parser.pegjs AST: Store rules in an array instead of an object 12 years ago
passes.js Fix a bug in param name fixup code for sequences 12 years ago
peg.js Add a note about semantic versioning to |PEG.VERSION| comment 12 years ago
utils.js AST: Store rules in an array instead of an object 12 years ago