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

Implement search_for! using functions #491

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

DaniPopes
Copy link
Contributor

Avoid unnecessary monomorphization due to macro inlining of closures. This can't always be a method because of double borrows when searching mutably.

@DaniPopes DaniPopes requested a review from a team as a code owner December 11, 2024 03:39
@DaniPopes DaniPopes requested review from ezrosent and removed request for a team December 11, 2024 03:39
Copy link

codspeed-hq bot commented Dec 11, 2024

CodSpeed Performance Report

Merging #491 will not alter performance

Comparing DaniPopes:search-for-fn (ba4c3ae) with main (115ecf3)

Summary

✅ 8 untouched benchmarks

Avoid unnecessary monomorphization due to macro inlining of closures.
This can't always be a method because of double borrows when searching
mutably.
let Ok(entry) = self.table.find_entry(hash, search_for!(self, hash, inp)) else {
let Ok(entry) = self
.table
.find_entry(hash, search_for(&self.vals, hash, inp))
Copy link
Collaborator

Choose a reason for hiding this comment

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

this can just use self.search_for? (similarly above)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It would cause a double borrow error

@yihozhang yihozhang merged commit 606b24a into egraphs-good:main Dec 13, 2024
5 checks passed
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.

3 participants