4 ms·
If you consider the raw languages, C/C++ is indeed faster. But unfortunately it's not that easy. It's easier and faster to write a program in python that in C+
by koonsolo 11y ago
If you consider the raw languages, C/C++ is indeed faster. But unfortunately it's not that easy.
It's easier and faster to write a program in python that in C++. So given limited programmer time, it might be possible to write a faster solution in python than in C/C++ because you have more time to optimize your algorithm instead of fighting with the compiler. If you have a big project, you can spend the extra programmer time you gain by using python by moving crucial code from python to C. The crucial code can be found by using a profiler. (Saw an article about this some time ago, but don't remember which company actually did this)
Finally, python has a lot of math libraries that offer good speed for computation intensive operations, see http://www.scipy.org/ http://www.scipy.org/.
So yes, it's not that easy. I would suggest use Python because it programs easier/faster, and if you really run into a wall, you can always port parts to C.