-
Notifications
You must be signed in to change notification settings - Fork 16
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
Deeply nested IF statements take very long to parse #1015
Comments
That's odd. Thank you for reporting I could confirm. I'll have a look on the weekend. |
This is a tricky one. The problem is with parsing the formula and building the AST. I was trying to build a trace for this formula via the Peggy trace option and aborted the run after 6h and a 500GB trace file. I used an simpler version of the formula and built a trace which resulted in 20k lines: const formulon = require('../lib/formulon.js');
formulon.ast("IF(INCLUDES(SomeField__c ,'S1'),'Negative',\"\")") Any help to optimizing this would be greatly appreciated. |
I messed around a bit with the tracing format and got something like:
I think it tries to match with the first alternative of When I changed
This specific expression parsed in ~1K trace lines. But of course this isn't a general solution. |
Seems like I got a fix with #1040. Essentially what I did was instead of recursively parsing logical concatenation ( This way the Can you test on branch |
🎉 This issue has been resolved in version 6.25.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
For example, calling
extract
on the following formula takes more than three minutes on my machine. Using this formula informulon.io
shows similar behavior.The text was updated successfully, but these errors were encountered: