Jun-17-2020, 04:39 PM
It's pretty much a fact that Python is slower than other languages, especially ones like C++ which have a low abstraction level. Python has stuff like dynamic variable naming, automatic garbage collection etc, which just abstracts it even further from the base computer.
And then there's the fact that Python is interpreted while C++ is compiled. Compiled programs are high level programs converted to low level code. Due to this, it executes much faster.
It's a common technique to re-write certain parts of large Python programs with C++ when speed and performance is critical. You could try this approach.
If you want to learn more about Abstraction, what it is, how it effects performance etc, you can read all about it in this article.
And then there's the fact that Python is interpreted while C++ is compiled. Compiled programs are high level programs converted to low level code. Due to this, it executes much faster.
It's a common technique to re-write certain parts of large Python programs with C++ when speed and performance is critical. You could try this approach.
If you want to learn more about Abstraction, what it is, how it effects performance etc, you can read all about it in this article.