Skip to content
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

Reduce environment allocations #4002

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

raskad
Copy link
Member

@raskad raskad commented Sep 22, 2024

This PR builds on #3988 and removes runtime environment allocations when possible.
All three commits can be reviewd independently. I just put them all together here, because they depend on each other anyways.

Running the benchmarks did not show a big reduction in execution time, but this should reduce memory usage since we can skip and reduce size of allocations.

  • Skip environment creation when all bindings in the scope are local
  • Skip environment creation when possible for arrow functions
  • Do not allocate space for local bindings in runtime environments

@raskad raskad added execution Issues or PRs related to code execution ast Issue surrounding the abstract syntax tree labels Sep 22, 2024
@raskad raskad added this to the next-release milestone Sep 22, 2024
Copy link

Test262 conformance changes

Test result main count PR count difference
Total 48,494 48,494 0
Passed 43,609 43,609 0
Ignored 1,500 1,500 0
Failed 3,385 3,385 0
Panics 0 0 0
Conformance 89.93% 89.93% 0.00%

@raskad raskad requested a review from a team September 23, 2024 00:01
Copy link
Member

@HalidOdat HalidOdat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Looks great to me! :)

@HalidOdat HalidOdat requested a review from a team September 28, 2024 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ast Issue surrounding the abstract syntax tree execution Issues or PRs related to code execution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants