dmajda/pegjs — Issue #61: PEG.buildParser efficiency
Author: islandr
Created: 2011-12-06 00:01:37+00:00
State: open

What's the proper way to efficiently define a grammar that includes hundreds (if not thousands) of possible values for a given rule?

I'm using PEG.js to drive an autocomplete on my site and it was working great until the number of values grew into the couple hundred. The parser is built on the fly from a dynamically generated grammar, and it typically locks up the browser for a good 20-30 seconds while building the parser.

Here's an example gist you can try out to see the delay I'm talking about.

https://gist.github.com/1435954