You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recentily started to take a look at PyBind11 and I found it to be interesting. I decided to follow a Microsoft tutorial for my first project. Tutorial
And everything was smooth sailing. The thing is that my benchmark results look nothing like the one attached in the tutorial. I understand that I can possibly be microbenchmarking but at the end of the day I am doing the same thing, so I do not understand such a big difference.
Tutorial:
Running benchmarks with COUNT = 500000
[tanh(x) for x in d] (Python implementation) took 0.758 seconds
[fast_tanh(x) for x in d] (CPython C++ extension) took 0.076 seconds
[fast_tanh2(x) for x in d] (PyBind11 C++ extension) took 0.204 seconds
Debug:
Running benchmarks with COUNT = 500000
[tanh(x) for x in d] (Python implementation) took 3.565 seconds
[fast_tanh(x) for x in d] (PyBind11 C++ extension) took 3.289 seconds
Start without Debugging (Ctrl + F5):
Running benchmarks with COUNT = 500000
[tanh(x) for x in d] (Python implementation) took 0.274 seconds
[fast_tanh(x) for x in d] (PyBind11 C++ extension) took 3.170 seconds
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello Pybind11 community,
I recentily started to take a look at PyBind11 and I found it to be interesting. I decided to follow a Microsoft tutorial for my first project. Tutorial
And everything was smooth sailing. The thing is that my benchmark results look nothing like the one attached in the tutorial. I understand that I can possibly be microbenchmarking but at the end of the day I am doing the same thing, so I do not understand such a big difference.
Tutorial:
Debug:
Start without Debugging (Ctrl + F5):
Any ideas?
Beta Was this translation helpful? Give feedback.
All reactions