Python 2.x vs 3.x Speed

后端 未结 5 1618
礼貌的吻别
礼貌的吻别 2021-02-06 22:32

I\'m a PhD student and use Python to write the code I use for my research. My workflow often consists of making a small change to the code, running the program, seeing whether

5条回答
  •  旧巷少年郎
    2021-02-06 22:55

    This article (archive.org) said that there were a few points where Python 3.0 was actually slower than Python 2.6, though I think many of these issues were resolved. That being said, Numpy hasn't been brought over to Python 3.0 yet and that's where a lot of the high performance (written in c) number functionality stuff is hiding. Hopefully it will be ready late 2009 or early 2010.

    You should not consider performance to be a justification to switch to Python 3; I don't think you'll see a consistent speed improvement.

    Edit: Versions of Numpy which support Python 3 have since been released.

    Edit2: This answer (and other answers to this question) are outdated.

提交回复
热议问题