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

Slow compile times #15

Closed
xogeny opened this issue May 21, 2018 · 2 comments
Closed

Slow compile times #15

xogeny opened this issue May 21, 2018 · 2 comments

Comments

@xogeny
Copy link

xogeny commented May 21, 2018

I have two relatively simple grammars. But the problem is that if I generate TypeScript code (as described in the README), the TypeScript compiler takes forever to compile the generated code. Is there a setting or annotation that helps with the compilation times? As it is, it is pretty much unusable for me.

@gavbaa
Copy link

gavbaa commented May 21, 2018

There was a change somewhere in the middle of TS 2.1 (2.1.3 I believe?) that made a significant behavior change to the way types are parsed. The only way I got decent performance was setting "noImplicitAny": false, in my tsconfig.json. That took the compile times from 4 minutes to a few seconds. I never dug into the specifics of how that improvement worked or how to fix it more correctly, but this at least makes things workable.

@pjmolina
Copy link
Contributor

Hi @xogeny and @gavbaa !
Sometime ago, I reported a bug: TS/17033 to the TypeScript team.
It looks like the way pegjs generates code makes TS compiler to suffer a little.
In the meantime, yes noImplicitAny is one of the ways to overcome this limitation.

Closing this issue for the moment: as we cannot do nothing at the pluggin level about it, but awaiting for TS compiler to fix, or a big refector in pegjs library itself.

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

No branches or pull requests

3 participants