r/cpp • • Jun 21 '26

Pymetabind: Writing pybind11 bindings with C++26 reflections

https://codeberg.org/bstaletic/pymetabind/
81 Upvotes

26 comments sorted by

View all comments

Show parent comment

1

u/_bstaletic Jun 22 '26

I may have been too terse with that statement.

In my case, part of the benchmark suite were purely c++ benchmarks and another part of the suite dealt with py::lists. To my surprise all benchmarks were affected equally. I do compile the bindings as part of the rest of the project, so everything gets compiled with -O3, against nanobind's recommendations. I think I've messed with NOMINSIZE argument of nanobind_add_module(), but it's been a long time, so don't take my word for it.

 

Yes, I was surprised by the numbers I saw as well. nanobind definitely did make some improvements that I was convinced would make it beat pybind11.