-
Notifications
You must be signed in to change notification settings - Fork 514
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
Optimizations for the generated parser #2358
Optimizations for the generated parser #2358
Conversation
@@ -15,6 +15,11 @@ | |||
var _b_ = __BRYTHON__.builtins | |||
|
|||
const Load = new $B.ast.Load() | |||
const NULL = undefined; | |||
const ENDMARKER = 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was necessary to get the nodejs profiler running, but didn't seem necessary in the browser. I didn't have the time to dig into exactly why that discrepancy exists.
Once again impressive work Austin ! I am currently working on a separate branch |
Thank you, and yes! I updated this PR to merge into the |
…ated-parser-optimizations
Merge conflicts fixed! I verified that datetime still parses, but I didn't run the full test suite on this branch. What's your current process for running the built-in test suite on the generated parser? |
I ran the test suite with the page After fixing a bug in The next step is to test all the scripts in the gallery, the documentation etc. before I can merge the branch into master. Thanks once again Austin, this is a major step forward for Brython ! |
Very exciting! I'm happy to have been able to help out some. Thanks for all your work on this Pierre! |
Changes made
break
to simulate the C parser'sgoto
behavior, instead of creating and calling adone()
functionPyBytes_FromStringAndSize
when tokenizing. I verified that.bytes
was never read during execution. But it's possible that this wasn't a valid change.Performance improvements
Here's are the times I see on my laptop for the datetime tests:
And here's an additional datapoint from my pyperformance tests:
So I think we're sitting around 1.7x slower than the legacy parser after these improvements.