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

Don't inline Apply across lambdas #1304

Merged
merged 1 commit into from
Dec 10, 2024
Merged

Conversation

johnynek
Copy link
Owner

@johnynek johnynek commented Dec 10, 2024

if we have:

x = f(y)

z -> (x, z)

it looks like you could inline x = f(y) but the problem is we have no idea how many times the lambda will be called. By moving that in we could massively blow up function run time since a constant may not be un-cached. This also changes what closures close over. Without a good reason to do this, it shouldn't be the default.

I noticed some code being generated that surprised me due to this behavior.

@johnynek johnynek merged commit 4bad1ba into main Dec 10, 2024
8 checks passed
@johnynek johnynek deleted the oscar/20241210-limit_lambda_inline branch December 10, 2024 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant