Repository navigation
Conversation
bioball
marked this pull request as draft
September 21, 2026 20:59
HT154
reviewed
Sep 21, 2026
HT154
left a comment
Contributor
There was a problem hiding this comment.
Very slick! Any idea what, if any, real world perf impact this has?
bioball
force-pushed
the
optimize-lambdas
branch
from
September 22, 2026 05:23
a29a134 to
0abdba4
Compare
Member
Author
Right now, I'm not seeing any performance impact when testing against existing codebases, which I'm really surprised by. I ran a test against a project that gave me about an 83% capture rate (17% of objects skipped capturing their closure), and the eval time is basically identical (tested using both Graal JDK and native image). Not really sure why, this change should help the truffle inline much more code. But, I still have a lot of PE fixes incoming, so maybe this change won't affect anything until that's applied. |
bioball
force-pushed
the
optimize-lambdas
branch
from
September 22, 2026 17:40
0abdba4 to
bf92dcb
Compare
bioball
force-pushed
the
optimize-lambdas
branch
from
October 17, 2026 17:00
bf92dcb to
473cf80
Compare
This implements an optimization where functions and objects don't retain a closure if they don't need it. During parse time (inside AstBuilder), we determine whether a function or an object needs its enclosing scope. This then propagates to the truffle node that creates the runtime objects. If an object does not need to capture its closure, its enclosing frame does not get materialized.
bioball
force-pushed
the
optimize-lambdas
branch
from
October 17, 2026 17:01
473cf80 to
5e0836d
Compare
This branch has not been deployed
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.
This implements an optimization where functions and objects don't retain a closure if they don't need it.
During parse time (inside AstBuilder), we determine whether a function or an object needs its enclosing scope.
This then propagates to the truffle node that creates the runtime objects.
If an object does not need to capture its closure, its enclosing frame does not get materialized.