Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

True, just benchmarked it and found the function call overhead to be about 1.85834729e-7 seconds (185 ns). Which isn't much, but the pure C version would obviously be single nanoseconds for the handful of instructions needed depending on the function call.


185 ns is worse than function call overhead in Python (about 100 ns on this machine)


Python calling Python, Python calling out to a native module, or Python calling through ctypes?


Python calling a no-op Python function def foo(): pass


185 ns is enough to compute over 17k floating point operations on a single 3 GHz CPU (Intel Haswell/Broadwell) core.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: