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

Use match_shared in the main eval loop #1698

Merged
merged 8 commits into from
Oct 25, 2023
Merged

Conversation

yannham
Copy link
Member

@yannham yannham commented Oct 25, 2023

A long standing todo was to use match_shared inside the main eval loop, such that some operations (typically array and record closurization) don't have to unduly copy data if they can take ownership on a 1-counted Rc. We were just waiting for nice formatting which has landed in #1677.

It doesn't seem to have a huge effect on #1622 (the effect is expected to be more salient on either small programs or programs with huge arrays and records), in one direction or another, and the benchmarks are way too volatile right now to make any sense of them (it's an important, but a separate one). If anything, this PR improves the documentation and the signature of various evaluation functions by returning closures instead of tuples.

@yannham yannham requested review from Radvendii, jneem and vkleen October 25, 2023 11:09
@github-actions github-actions bot temporarily deployed to pull request October 25, 2023 11:16 Inactive
Copy link
Contributor

@Radvendii Radvendii left a comment

Choose a reason for hiding this comment

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

There are a bunch of places where you've removed clone() calls because now we're taking ownership, but there are other places where the clone() calls have stuck around, and I'm not sure if that's because something different is happening there or because you missed them.

I only marked a couple of them, but saw a bunch more.

core/src/eval/mod.rs Show resolved Hide resolved
core/src/eval/mod.rs Outdated Show resolved Hide resolved
core/src/eval/mod.rs Show resolved Hide resolved
core/src/eval/mod.rs Show resolved Hide resolved
@yannham
Copy link
Member Author

yannham commented Oct 25, 2023

Good catch, I thought I had them all, but did an additional search and fix and got a few more. Now there shouldn't be remaining undue clones in eval_closure

@yannham yannham requested a review from Radvendii October 25, 2023 17:22
@github-actions github-actions bot temporarily deployed to pull request October 25, 2023 17:27 Inactive
@yannham yannham force-pushed the optimize/eval-matche-shared branch from 020b712 to 39bad0d Compare October 25, 2023 18:37
@github-actions github-actions bot temporarily deployed to pull request October 25, 2023 18:41 Inactive
@yannham yannham added this pull request to the merge queue Oct 25, 2023
Merged via the queue into master with commit 5b7d59a Oct 25, 2023
4 checks passed
@yannham yannham deleted the optimize/eval-matche-shared branch October 25, 2023 21:07
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.

2 participants