- Joined
- 3/21/08
- Messages
- 593
- Points
- 38
60 times faster!!!!On a somewhat related comparison, I ported C++ code to price financial derivatives (options) to Python to get a feeling for relative run-time performance., This is essentially a one-step algorithm in a double nested 'for' loop and random number generators are used in both cases (Mersenne Twister 19937)
Conclusion C++ is 60 times faster!
Just looking at the random number generator part, using Numba improves performance appreciably (Python is 1 1/2 times slower). In more complicated code it is not obvious how to use numba. In this case 'pure' Python would not be suitable for production purposes but it would be useful for prototyping.
you said it all