-
Notifications
You must be signed in to change notification settings - Fork 1
Description
So I noticed what seems to be an exponential performance drop while doing another stress test. I remade my fork to illustrate the issue here and made a few optimization tweaks to the side-associative helper functions to (unsuccessfully) try to help alleviate the issue.
When you get to around 6 nested parentheses, ((((((6)))))), it takes about 830ms to parse the expression, at least on my machine. Adding one more for 7 nested parentheses bumps that all the way up to about 5000ms.
When testing in 2.0.0-rc.2 the same performance drop is there, it just takes around 8 nested parentheses before getting to be about 800ms. 9 nested parentheses gets up to around 4100ms.
I don't know how severe you consider this issue to be right now, but it seems like it will only get worse once/if we proceed with adding conditionals, as that would probably add another 5 or 6 peg rules.
I could be too inexperienced with PEG.js to be coming to this conclusion given that I only became aware of it two weeks ago, but this seems to be an issue on their end as your peg file seems to match the format of the examples they give. I'm really not sure what we can do about this one.