Skip to content
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

make jison compiles go faster #5476

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cosmicexplorer
Copy link
Contributor

Problem

Jison compiles parser.js very slowly:

> time cake build:parser
cake build:parser  11.65s user 0.24s system 107% cpu 11.044 total

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 run cake build twice!).

Solution

Result

The generated parser seems to be byte-for-byte the same, while being generated much faster:

> time cake build:parser
cake build:parser  4.63s user 0.49s system 123% cpu 4.147 total

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

  • The package.json entry 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.
    • We could also vendor Jison (since it doesn't seem to be actively maintained).

- see zaach/jison#408 for a discussion of the changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant