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

migrate to pybind11 #48

Merged
merged 48 commits into from
Oct 12, 2024
Merged

migrate to pybind11 #48

merged 48 commits into from
Oct 12, 2024

Conversation

jmoralez
Copy link
Member

@jmoralez jmoralez commented Aug 22, 2024

Migrates from ctypes to pybind11. The main motivation is to reduce the function call overhead, since for the single array functions it was noticeable, for example the exponentially_weighted_mean function is 2.4x faster with pybind11.

This also allows:

  • Using more C++ by not having to expose a C API.
  • More safety when passing arguments from Python to C++ (type checks and coercion if necessary).
  • More flexibility in function returns, for example we can allocate objects on the C++ side and return them back to python.

Copy link

codspeed-hq bot commented Aug 22, 2024

CodSpeed Performance Report

Merging #48 will improve performances by ×2.4

Comparing pybind11 (0276b85) with main (f15816a)

Summary

⚡ 3 improvements
✅ 17 untouched benchmarks

Benchmarks breakdown

Benchmark main pybind11 Change
test_ewm 140.8 µs 58.8 µs ×2.4
test_lag_transforms[seasonal_rolling_max] 43.8 ms 38.1 ms +15.1%
test_lag_transforms[seasonal_rolling_min] 44.9 ms 39.2 ms +14.66%

@jmoralez jmoralez changed the title pybind11 migrate to pybind11 Oct 12, 2024
@jmoralez jmoralez marked this pull request as ready for review October 12, 2024 23:37
@jmoralez jmoralez merged commit 0f9f3f3 into main Oct 12, 2024
30 checks passed
@jmoralez jmoralez deleted the pybind11 branch October 12, 2024 23:39
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