[Python-Dev] FAT Python (lack of) performance
INADA Naoki
songofacandy at gmail.com
Tue Jan 26 00:02:31 EST 2016
Do you say I and many people are so fool?
People use same algorithm on every language when compares base language
performance [1].
[1] There are no solid definition about "Base language performance".
But it includes function call, method lookup, GC. It may include basic
string and arithmetic operations.
See here for example:
http://d.hatena.ne.jp/satosystems/20121228/1356655565
This article is written in 2012.
In this article, php 5.3 takes 85sec, Python 2.7 takes 53sec and CRuby 1.8
takes 213sec. (!!)
For now:
$ python2 -V
Python 2.7.11
$ time python2 -S fib.py
39088169
real 0m17.133s
user 0m16.970s
sys 0m0.055s
$ python3 -V
Python 3.5.1
$ time python3 -S fib.py
39088169
real 0m21.380s
user 0m21.337s
sys 0m0.028s
$ php -v
PHP 7.0.2 (cli) (built: Jan 7 2016 10:40:21) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies
$ time php fib.php
39088169
real 0m7.706s
user 0m7.654s
sys 0m0.027s
$ ruby -v
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin14]
$ time ruby fib.rb
39088169
real 0m6.195s
user 0m6.124s
sys 0m0.032s
Fibonacci microbench measures performance of function call.
When I said "Base language performance", I meant performance of
function call, attribute lookup, GC, etc...
PHP and Ruby made grate effort to improve base language performance.
While I'm fan of Python, I respect people made PHP and Ruby faster.
Of course, I respect people making Python faster too.
But I wonder if CPython is more faster, especially about global lookup and
function call.
--
INADA Naoki <songofacandy at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20160126/30442262/attachment.html>
More information about the Python-Dev
mailing list