Why are Python Programs often slower than the Equivalent Program Written in C or C++? -


Why does Python look slower on average than C / C ++? I learned Python as my first programming language, but I have only started with C and already I think that I see a clear difference.

Python is a C-level language, which means that your statement from the computer - memory Management, pointers, etc., and allows you to write such programs as how human beings think.

It is true that C code usually runs 10 to 100 times faster than the Python code. If you only evaluate execution time, however, if you also include the time of development, then the dragon is often Beats Development of time for many projects is far more important than run time performance. Long-term development time directly converts the market into additional costs, fewer features and slow speeds.

The reason for this is internally that the Python code executes more slowly, because the code is compiled in a timed manner,.

Other interpreting languages ​​such as Java bytecode and. NET bytecode runs faster than Python because it compiles the original code by bitcodes on the runtime in standard delivery. The reason is that the Jeep compiler in CPIthon is not already, because the dynamic nature of the dragon makes it difficult to write one. There is a fast Python runtime to write so that you should expect that the performance difference in the future will be reduced, but it may possibly be some time before a powerful JIT compiler is included in standard Python distribution.


Comments

Post a Comment

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -