简体   繁体   中英

Why is Python3 slower than Python2?

I have seen some benchmark graphs while googling that represents Python is faster and consumes less memory than Python3.

Here is the link to the article: https://raid6.com.au/~onlyjob/posts/arena/

(Sorry that I cannot post an image due to lack of reputations.)

I've seen some questions and answers in stackoverflow, but some people are saying Python3 is rather faster. So I am curious to know the truth.

Are those graphs and charts true? or is it not viable now?

While all benchmarks are flawed, this one is more so than most.

  1. These test results are from 2011. Software has not stood still since then. Current versions of Python 3 perform comparably with Python 2.7, if not better. Similarly, modern versions of the other languages in this benchmark will likely outperform the versions which were tested.

  2. The operations being performed in this benchmark are pretty strange (repeatedly appending to a string, then performing search-and-replace operations on it). They aren't representative of the overall performance of a language.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM