Open
Conversation
- see zaach/jison#408 for a discussion of the changes
Contributor
|
Take a look at the solar.coffee parser generator in #5495 I originally was based on Jison, but totally rewrote it from scratch. I now generate the parser.js file for CoffeeScript in less than 100ms, down from 12.5 seconds. |
Contributor
Author
|
The reason I spent the time to fix jison instead of rewriting it was the hope that it would be easier for maintainers to review a change. Rewriting it is the easy part. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Jison compiles
parser.jsvery slowly:Since the parser is also compiled whenever we run
cake build, this means any change to the compiler takes ~12 seconds to reload (or almost 30 seconds if you runcake buildtwice!).Solution
Result
The generated parser seems to be byte-for-byte the same, while being generated much faster:
We can go even faster (https://github.com/cosmicexplorer/jison/tree/performance-work-for-coffeescript), but the additional changes in that branch are quite extensive, and don't produce a significant performance improvement. This change is easy to audit and does most of the work.
TODO
package.jsonentry points to my own github user repository. It's pinned to a commit, so it can't change, but if we're going to use a git reference, it should probably be owned by a maintainer of the repo.