Slow compile times
xogeny opened this issue · 2 comments
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.
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.
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.