4 ms·
Not really surprising: Except for some very limited cases, I found that python performance is comparable to C++ performance for solving problems (obviously usin
by veyron 14y ago
Not really surprising: Except for some very limited cases, I found that python performance is comparable to C++ performance for solving problems (obviously using python/C++ idioms where relevant). I rarely use C++, opting for C for performance reasons.
- charliesome 14y ago> Except for some very limited cases, I found that python performance is comparable to C++ performance for solving problems I have a hard time buying this. What cases have you found where Python is comparable to C++?
- cageface 14y agoPython is comparable to C/C++ when the code you write spends most of its time in the many Python libraries which are written in C. If your program spends most of its time actually executing code in Python then a comparable C++ implementation will probably be two or more orders of magnitude faster.
- mseepgood 14y agoWhen he uses NumPy that is implemented in C.
- eswangren 14y agoAnd by "limited cases" I assume you mean "performance critical code"?
- veyron 14y agoeven in performance critical code, unless you are doing some very aggressive bit twiddling or assembly-level optimizations, python can hold its own. Although at that point, C is easier to work with ...