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

Pyerr value bound #3820

Merged
merged 19 commits into from
Feb 17, 2024
Merged

Pyerr value bound #3820

merged 19 commits into from
Feb 17, 2024

Conversation

LilyFoote
Copy link
Contributor

Implements more of the Bound api from #3684.

Follows on from #3819.

src/exceptions.rs Outdated Show resolved Hide resolved
src/err/mod.rs Outdated Show resolved Hide resolved
Copy link

codspeed-hq bot commented Feb 11, 2024

CodSpeed Performance Report

Merging #3820 will degrade performances by 15.02%

Comparing LilyFoote:pyerr-value-bound (bb1701b) with main (c24478e)

Summary

⚡ 1 improvements
❌ 2 regressions
✅ 76 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark main LilyFoote:pyerr-value-bound Change
list_via_downcast 157.2 ns 185 ns -15.02%
not_a_list_via_downcast 244.4 ns 216.7 ns +12.82%
sequence_from_tuple 232.8 ns 260.6 ns -10.66%

@LilyFoote LilyFoote marked this pull request as ready for review February 11, 2024 12:53
@LilyFoote LilyFoote mentioned this pull request Feb 11, 2024
@davidhewitt
Copy link
Member

Thanks so much for continuing onto this and also the follow-on in #3826 .

I'll hold off on reviewing this just until it's rebased post merge of #3819. (I also have quite a few things I'm trying to finish up this evening...)

Copy link
Member

@davidhewitt davidhewitt left a comment

Choose a reason for hiding this comment

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

Thanks again for picking this one up!

Quite a few comments here, mostly related to removing .clone() to avoid the reference counting cycles when we can, for efficiency wins 😄

src/err/err_state.rs Outdated Show resolved Hide resolved
src/err/err_state.rs Outdated Show resolved Hide resolved
src/err/mod.rs Outdated Show resolved Hide resolved
src/err/mod.rs Outdated Show resolved Hide resolved
src/err/mod.rs Outdated Show resolved Hide resolved
src/err/mod.rs Outdated Show resolved Hide resolved
src/exceptions.rs Outdated Show resolved Hide resolved
Copy link
Member

@davidhewitt davidhewitt left a comment

Choose a reason for hiding this comment

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

Whew, getting there, thanks for the iterations! This one has turned out to be quite fiddly.

I think the biggest thing remaining is whether from_value_bound should just take Bound instead of &Bound; I think if you agree with that idea then it'll lead to a few more changes 🙈

src/err/mod.rs Outdated Show resolved Hide resolved
src/err/err_state.rs Outdated Show resolved Hide resolved
src/err/mod.rs Outdated Show resolved Hide resolved
src/err/mod.rs Outdated Show resolved Hide resolved
src/exceptions.rs Outdated Show resolved Hide resolved
src/tests/common.rs Outdated Show resolved Hide resolved
Copy link
Member

@davidhewitt davidhewitt left a comment

Choose a reason for hiding this comment

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

I think we're there! There's just a few stylistic nits, and then let's merge this. Thank you for the several rounds of iteration on this one; turned out to have quite a few design points!

src/err/mod.rs Outdated Show resolved Hide resolved
src/err/mod.rs Outdated Show resolved Hide resolved
src/err/mod.rs Outdated Show resolved Hide resolved
src/err/mod.rs Outdated Show resolved Hide resolved
src/exceptions.rs Outdated Show resolved Hide resolved
Copy link
Member

@davidhewitt davidhewitt left a comment

Choose a reason for hiding this comment

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

🚀

@davidhewitt davidhewitt added this pull request to the merge queue Feb 17, 2024
Merged via the queue into PyO3:main with commit 940804f Feb 17, 2024
36 of 39 checks passed
@LilyFoote LilyFoote deleted the pyerr-value-bound branch February 17, 2024 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI-skip-changelog Skip checking changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants