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

port PyComplex::from_complex to Bound API #3866

Merged
merged 2 commits into from
Feb 19, 2024
Merged

Conversation

Icxolu
Copy link
Contributor

@Icxolu Icxolu commented Feb 18, 2024

Part of #3684

This ports the PyComplex::from_complex constructor of the num-complex interop to the Bound API

Copy link

codspeed-hq bot commented Feb 18, 2024

CodSpeed Performance Report

Merging #3866 will degrade performances by 10.2%

Comparing Icxolu:num-complex (db8e4b7) with main (f04ad56)

Summary

⚡ 4 improvements
❌ 1 regressions
✅ 74 untouched benchmarks

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

Benchmarks breakdown

Benchmark main Icxolu:num-complex Change
extract_float_extract_success 500.6 ns 445 ns +12.48%
extract_str_downcast_success 728.9 ns 645.6 ns +12.91%
list_via_extract 364.4 ns 308.9 ns +17.99%
not_a_list_via_downcast 244.4 ns 272.2 ns -10.2%
sequence_from_tuple 267.2 ns 239.4 ns +11.6%

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, looks good to me too! Just one thing I spotted which maybe we should add here...

@@ -283,7 +283,7 @@ pub(crate) mod bytes;
pub(crate) mod capsule;
#[cfg(not(Py_LIMITED_API))]
mod code;
mod complex;
pub(crate) mod complex;
Copy link
Member

Choose a reason for hiding this comment

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

Ooops we missed PyComplexMethods from the prelude too, mind adding at the same time please?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch! Added it in another commit.

@davidhewitt davidhewitt added the CI-skip-changelog Skip checking changelog entry label Feb 18, 2024
@davidhewitt davidhewitt added this pull request to the merge queue Feb 18, 2024
Merged via the queue into PyO3:main with commit 0bb9cab Feb 19, 2024
36 of 39 checks passed
@Icxolu Icxolu deleted the num-complex branch February 19, 2024 18: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.

3 participants