On a question of just performance, how does Python 3 compare to Python 2.x?
3.0 is slower than 2.5 on official benchmarks. From "What’s New in Python 3.0":
The net result of the 3.0 generalizations is that Python 3.0 runs the pystone benchmark around 10% slower than Python 2.5. Most likely the biggest cause is the removal of special-casing for small integers. There’s room for improvement, but it will happen after 3.0 is released!
I'd say any difference will be below trivial. For example, looping over a list will be the exact same.
The idea behind Python 3 is to clean up the language syntax itself - remove ambigious stuff like except Exception1, Exception2
, cleanup the standard modules (no urllib, urllib2, httplib etc).
There really isn't much you can do to improve it's performance, although I imagine stuff like the garbage collection and memory management code will have had some tweaks, but it's not going to be a "wow, my database statistic generation code completes in half the time!" improvement - that's something you get by improving the code, rather than the language!
Really, performance of the language is irrelevant - all interpreted languages basically function at the same speed. Why I find Python "faster" is all the built-in moudles, and the nice-to-write syntax - something that has been improved in Python3, so I guess in those terms, yes, python3's performance is better then python2.x..
I think ultimately it is too early to make that kind of comparison just yet. Wait until it is out of beta before benchmarking it. The interpreter will probably be polished enormously before the release but overall i think for most uses the performance would be comparable and if you are running a really speed conscious app is python really the right language to be using?
Unless there are plans for a new VM of some kind (and I haven't heard of any such plans), there is all the reason to believe that in the long run the performance of Py3K will, at least asymptotically, equal that of 2.5
It may take a few months, but will eventually happen, as nothing in the new features of Py3k is inherently less performant.
To conclude, I don't think there's place to worry about it. Neither to hope for a major improvement of some kind.
I don't if it faster now, but I have to expect that it eventually will be because that is where new performance work will happen and not all of that will be backported.
© 2022 - 2024 — McMap. All rights reserved.