-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement compaction #32
Comments
Compaction for everything aside from Two things remain to try:
|
I was able to find a way to implement In both cases, I found a serious problem with the whole concept of lazy val p: Parser[Any] = p ~ "a" | "a" Apply More conservative compaction (of just So basically, |
does this mean that the goal of coming within the ballpark of parboiled performance is not attainable anymore? |
@weihsiu Sorry for the delay in responding… It's unclear actually what the attainable performance is. Efforts here have stalled out on two extremely stupid factors: obtaining a large (millions of lines) set of C sources to test a realistic grammar, and simply my own lack of spare time over the past few months. It's entirely possible that my current benchmarking (which is based on a simple expr grammar) is hitting an inherent pathology in the algorithm. It's certainly quite similar to a known pathological case, so this seems like a real possibility and not just wishful thinking. The goal would be to benchmark with a real grammar (in this case, ANSII C) to see how things actually work in practice, but that has been held up on fiddling with the C preprocessor in order to generate an appropriate corpus. In the worst case, the performance will remain bad, and we won't be able to replicate the results from the Adams paper due to the constraints of our problem space (thread safety, producing errors, and parsing rather than recognition). If that is indeed the case, then it calls into question the practical applicability of the algorithm, though more implementation work will be needed to really make that assertion. |
The original Might, Darias and Spiewak paper reported a 90x speed-up when implementing compaction. Adams, Hollenbeck and Might validated this, as well as providing some improvements to the grammar traversals introduced by repeated compaction.
The text was updated successfully, but these errors were encountered: