oowekyala / intellij-javacc

JavaCC and JJTree grammar support for the IntelliJ Platform
https://plugins.jetbrains.com/plugin/11431-javacc
MIT License
44 stars 6 forks source link

Performance on large grammar files is not so good #24

Open d2a-raudenaerde opened 2 years ago

d2a-raudenaerde commented 2 years ago

I'm working on the jsqlparser, and editting the jjt in Intellij with the javacc plugin, makes my laptop go 100% cpu usage for over a minute.

The file itself: https://github.com/JSQLParser/JSqlParser/blob/master/src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjt

I'm on the latest intellij ultimate (2022.2) and plugin version: 1.10

oowekyala commented 2 years ago

Hi, I just profiled the plugin on your grammar. I think the problem is in that the java injection is slow (the injected Java file is very large). A workaround is to switch the injection level to "Partial" in Settings > Languagues and Frameworks > JavaCC, that improves the situation for me at least. I'm not sure what else I can do to improve this.

Capture d’écran de 2022-07-29 12-48-45

d2a-raudenaerde commented 2 years ago

Thanks for the quick reply. Unfortunately, it already is "Partial". I'll try turning it off as well.

d2a-raudenaerde commented 2 years ago

Setting to 'Disabled' keeps it working reasonably. Thanks for the tip!