2015年8月18日火曜日

pypy はえー

(2011/05/04 18:30公開、2015/08/18 2:45 更新)

名前が素敵な PyPy
http://sourceforge.jp/magazine/11/05/02/064241

MacPorts に早速 1.5 来てたので入れて、下記を実行
ここから拝借した)

import sys
import timeit

print (sys.version)
t = timeit.Timer("test.pystone.main()", "import test.pystone")
t.timeit(10)


・Python 2.7.1
2.7.1 (r271:86832, Dec 31 2010, 13:54:06)
[GCC 4.2.1 (Apple Inc. build 5664)]
Pystone(1.1) time for 50000 passes = 0.693661
This machine benchmarks at 72081.3 pystones/second
Pystone(1.1) time for 50000 passes = 0.6901
This machine benchmarks at 72453.3 pystones/second
Pystone(1.1) time for 50000 passes = 0.700685
This machine benchmarks at 71358.7 pystones/second
Pystone(1.1) time for 50000 passes = 0.69343
This machine benchmarks at 72105.3 pystones/second
Pystone(1.1) time for 50000 passes = 0.686145
This machine benchmarks at 72870.9 pystones/second
Pystone(1.1) time for 50000 passes = 0.696792
This machine benchmarks at 71757.4 pystones/second
Pystone(1.1) time for 50000 passes = 0.695822
This machine benchmarks at 71857.5 pystones/second
Pystone(1.1) time for 50000 passes = 0.685601
This machine benchmarks at 72928.7 pystones/second
Pystone(1.1) time for 50000 passes = 0.700942
This machine benchmarks at 71332.6 pystones/second
Pystone(1.1) time for 50000 passes = 0.699862
This machine benchmarks at 71442.7 pystones/second


・PyPy 1.5
2.7.1 (?, May 03 2011, 16:48:00)
[PyPy 1.5.0-alpha0 with GCC 4.0.1]
Pystone(1.1) time for 50000 passes = 0.267667
This machine benchmarks at 186799 pystones/second
Pystone(1.1) time for 50000 passes = 0.068037
This machine benchmarks at 734894 pystones/second
Pystone(1.1) time for 50000 passes = 0.067261
This machine benchmarks at 743373 pystones/second
Pystone(1.1) time for 50000 passes = 0.067966
This machine benchmarks at 735662 pystones/second
Pystone(1.1) time for 50000 passes = 0.067146
This machine benchmarks at 744646 pystones/second
Pystone(1.1) time for 50000 passes = 0.067497
This machine benchmarks at 740774 pystones/second
Pystone(1.1) time for 50000 passes = 0.067191
This machine benchmarks at 744147 pystones/second
Pystone(1.1) time for 50000 passes = 0.07886
This machine benchmarks at 634035 pystones/second
Pystone(1.1) time for 50000 passes = 0.068004
This machine benchmarks at 735251 pystones/second
Pystone(1.1) time for 50000 passes = 0.068635
This machine benchmarks at 728491 pystones/second


現実的なアプリケーションだとどのくらいになるのだろうね。
ここみると、Django は 8倍高速らしい。

2015/8/18 現在は以下 
2.7.10 (default, May 28 2015, 02:30:16)
[GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)]
Pystone(1.1) time for 50000 passes = 0.452571
This machine benchmarks at 110480 pystones/second
Pystone(1.1) time for 50000 passes = 0.455215
This machine benchmarks at 109838 pystones/second
Pystone(1.1) time for 50000 passes = 0.449152
This machine benchmarks at 111321 pystones/second
Pystone(1.1) time for 50000 passes = 0.450072
This machine benchmarks at 111093 pystones/second
Pystone(1.1) time for 50000 passes = 0.439352
This machine benchmarks at 113804 pystones/second
Pystone(1.1) time for 50000 passes = 0.453671
This machine benchmarks at 110212 pystones/second
Pystone(1.1) time for 50000 passes = 0.451542
This machine benchmarks at 110732 pystones/second
Pystone(1.1) time for 50000 passes = 0.450634
This machine benchmarks at 110955 pystones/second
Pystone(1.1) time for 50000 passes = 0.45061
This machine benchmarks at 110961 pystones/second
Pystone(1.1) time for 50000 passes = 0.461482
This machine benchmarks at 108347 pystones/second

3.4.3 (default, May 25 2015, 18:48:21)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)]
Pystone(1.2) time for 50000 passes = 0.550403
This machine benchmarks at 90842.5 pystones/second
Pystone(1.2) time for 50000 passes = 0.535997
This machine benchmarks at 93284.1 pystones/second
Pystone(1.2) time for 50000 passes = 0.533127
This machine benchmarks at 93786.3 pystones/second
Pystone(1.2) time for 50000 passes = 0.527765
This machine benchmarks at 94739.1 pystones/second
Pystone(1.2) time for 50000 passes = 0.536051
This machine benchmarks at 93274.7 pystones/second
Pystone(1.2) time for 50000 passes = 0.54033
This machine benchmarks at 92536 pystones/second
Pystone(1.2) time for 50000 passes = 0.535856
This machine benchmarks at 93308.7 pystones/second
Pystone(1.2) time for 50000 passes = 0.534745
This machine benchmarks at 93502.5 pystones/second
Pystone(1.2) time for 50000 passes = 0.524912
This machine benchmarks at 95254.1 pystones/second
Pystone(1.2) time for 50000 passes = 0.531086
This machine benchmarks at 94146.7 pystones/second

3.5.0rc1 (default, Aug 16 2015, 06:23:26)
[GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)]
Pystone(1.2) time for 50000 passes = 0.506479
This machine benchmarks at 98720.7 pystones/second
Pystone(1.2) time for 50000 passes = 0.508563
This machine benchmarks at 98316.2 pystones/second
Pystone(1.2) time for 50000 passes = 0.511506
This machine benchmarks at 97750.5 pystones/second
Pystone(1.2) time for 50000 passes = 0.501795
This machine benchmarks at 99642.3 pystones/second
Pystone(1.2) time for 50000 passes = 0.49656
This machine benchmarks at 100693 pystones/second
Pystone(1.2) time for 50000 passes = 0.49607
This machine benchmarks at 100792 pystones/second
Pystone(1.2) time for 50000 passes = 0.478405
This machine benchmarks at 104514 pystones/second
Pystone(1.2) time for 50000 passes = 0.482465
This machine benchmarks at 103634 pystones/second
Pystone(1.2) time for 50000 passes = 0.491406
This machine benchmarks at 101749 pystones/second
Pystone(1.2) time for 50000 passes = 0.484606
This machine benchmarks at 103177 pystones/second

2.7.9 (295ee98b69288471b0fcf2e0ede82ce5209eb90b, Jun 02 2015, 07:48:49)
[PyPy 2.6.0 with GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)]
Pystone(1.1) time for 50000 passes = 0.044237
This machine benchmarks at 1.13028e+06 pystones/second
Pystone(1.1) time for 50000 passes = 0.011606
This machine benchmarks at 4.30812e+06 pystones/second
Pystone(1.1) time for 50000 passes = 0.011401
This machine benchmarks at 4.38558e+06 pystones/second
Pystone(1.1) time for 50000 passes = 0.010419
This machine benchmarks at 4.79893e+06 pystones/second
Pystone(1.1) time for 50000 passes = 0.011264
This machine benchmarks at 4.43892e+06 pystones/second
Pystone(1.1) time for 50000 passes = 0.012208
This machine benchmarks at 4.09567e+06 pystones/second
Pystone(1.1) time for 50000 passes = 0.01142
This machine benchmarks at 4.37828e+06 pystones/second
Pystone(1.1) time for 50000 passes = 0.013389
This machine benchmarks at 3.73441e+06 pystones/second
Pystone(1.1) time for 50000 passes = 0.010013
This machine benchmarks at 4.99351e+06 pystones/second
Pystone(1.1) time for 50000 passes = 0.011098
This machine benchmarks at 4.50532e+06 pystones/second

0 件のコメント:

コメントを投稿