Draft
Conversation
Contributor
|
If there isn't rush, I can come back with benchmarks in parsing with and without this change against my fuzzing corpus. I am a bit overworked right now, so I don't think I can deliver it earlier than the end of next week. |
Contributor
Author
|
absolutely no rush, @LucaCappelletti94. (this was just an experiment which surprised me and i thought it's worth sharing.) if you'd manage to run it on some workload of yours it would be a great way to expose or exclude some error on my part. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Expr::Function(Function)aExpr::Function(Box<Function>)thereby reducing the size ofExprfrom 328 down to 216 bytes.Details
Details
enumCPU caches get better utilised manifesting in faster performance (at least when reading the AST.)Expritself, could further practically be reduced to about 80-100 bytes, though i'm not able to tell how much improvement that could contribute. (i've marked some candidates withXXXin this pr.)enums/structs, chieflyStatement, could be considered for this kind of change. there are really huge differences in sizes of the individual enum variants, leadingParser::parse(and related) to return needlessly large memory chunks (on average, of course.)Exprseemed very much prevalent in the AST, so i suppose this would be the biggest win / lowest hanging fruit.Boxis Rust, making it a pain in the neck to (re)write them without some additional helper functions (in this PR i just went straight to make it work without a lot of thought.)