>PyPy is a very compliant Python interpreter, almost a drop-in replacement for CPython. What still works in CPython but not PyPy?
PyPy 1.4: Ouroboros in practice
11–20 of 22 posts
Re: PyPy 1.4: Ouroboros in practice
#12Currently testing a CPU intensive algorithm I need for my current research project. Hoping it will save me some time. When I am done I will post the results! [Edit:] Pretty good so far! ~/stuff/Programming/faultire/src/ hendersont@glycineportable src $ time pypy sleepytree/test_metricspace.py ....... ---------------------------------------------------------------------- Ran 7 tests in 39.621s OK real 0m39.675s user 0…
~/stuff/Programming/sleepytree/
hendersont@glycineportable sleepytree $ time python test_metricspace.py -v
test_distance (__main__.TestCompare) ... ok
test_nondegenercy (__main__.TestCompare) ... ok
test_symmetry (__main__.TestCompare) ... ok
test_triangle_inequality (__main__.TestCompare) ... ok
test_contains (__main__.TestTestNode) ... ok
test_get (__main__.TestTestNode) ... ok
test_iter (__main__.TestTestNode) ... ok
----------------------------------------------------------------------
Ran 7 tests in 570.385s
OK
real 9m30.451s
user 9m23.920s
sys 0m1.730s
~/stuff/Programming/sleepytree/
hendersont@glycineportable sleepytree $ time pypy test_metricspace.py -v
test_distance (__main__.TestCompare) ... ok
test_nondegenercy (__main__.TestCompare) ... ok
test_symmetry (__main__.TestCompare) ... ok
test_triangle_inequality (__main__.TestCompare) ... ok
test_contains (__main__.TestTestNode) ... ok
test_get (__main__.TestTestNode) ... ok
test_iter (__main__.TestTestNode) ... ok
----------------------------------------------------------------------
Ran 7 tests in 255.339s
OK
real 4m15.396s
user 4m12.990s
sys 0m0.310sRe: PyPy 1.4: Ouroboros in practice
#13>PyPy is a very compliant Python interpreter, almost a drop-in replacement for CPython. What still works in CPython but not PyPy?
wxPython is something I personally miss.
Re: PyPy 1.4: Ouroboros in practice
#14>PyPy is a very compliant Python interpreter, almost a drop-in replacement for CPython. What still works in CPython but not PyPy?
Re: PyPy 1.4: Ouroboros in practice
#15Currently testing a CPU intensive algorithm I need for my current research project. Hoping it will save me some time. When I am done I will post the results! [Edit:] Pretty good so far! ~/stuff/Programming/faultire/src/ hendersont@glycineportable src $ time pypy sleepytree/test_metricspace.py ....... ---------------------------------------------------------------------- Ran 7 tests in 39.621s OK real 0m39.675s user 0…
Re: PyPy 1.4: Ouroboros in practice
#16>PyPy is a very compliant Python interpreter, almost a drop-in replacement for CPython. What still works in CPython but not PyPy?
Re: PyPy 1.4: Ouroboros in practice
#17Interesting and promising. PyPy 1.4: >>>> t1 = time.time(); a=[x*x for x in xrange(1000000)]; time.time()-t1 0.38609600067138672 >>>> t1 = time.time(); a=[x*x+math.sin(x/1000000.) for x in xrange(1000000)]; time.time()-t1 0.42182803153991699 Python 2.7: >>> t1 = time.time(); a=[x*x for x in xrange(1000000)]; time.time()-t1 0.25005197525024414 >>> t1 = time.time(); a=[x*x+math.sin(x/1000000.) for x in xrange(1000000)]…
$ pypy -mtimeit -s'import math; sin=math.sin' \
'[x*x+sin(x/1e6) for x in xrange(1000000)]'
10 loops, best of 3: 156 msec per loop
With no division it is slower (?): $ pypy -mtimeit -s'import math; sin=math.sin' \
'[x*x+sin(x) for x in xrange(1000000)]'
10 loops, best of 3: 188 msec per loop
CPython shows expected behavior: $ python2.7 -mtimeit -s'import math; sin=math.sin' \
'[x*x+sin(x) for x in xrange(1000000)]'
10 loops, best of 3: 231 msec per loop
$ python2.7 -mtimeit -s'import math; sin=math.sin' \
'[x*x+sin(x/1e6) for x in xrange(1000000)]'
10 loops, best of 3: 253 msec per loop
CPython is faster for tiny cases: $ pypy -mtimeit '[x*x for x in xrange(1000000)]'
10 loops, best of 3: 126 msec per loop
$ python2.7 -mtimeit '[x*x for x in xrange(1000000)]'
10 loops, best of 3: 67.3 msec per loop
$ pypy -mtimeit '[x*x*x for x in xrange(1000000)]'
10 loops, best of 3: 123 msec per loop
$ python2.7 -mtimeit '[x*x*x for x in xrange(1000000)]'
10 loops, best of 3: 118 msec per loopRe: PyPy 1.4: Ouroboros in practice
#18Re: PyPy 1.4: Ouroboros in practice
#19Currently testing a CPU intensive algorithm I need for my current research project. Hoping it will save me some time. When I am done I will post the results! [Edit:] Pretty good so far! ~/stuff/Programming/faultire/src/ hendersont@glycineportable src $ time pypy sleepytree/test_metricspace.py ....... ---------------------------------------------------------------------- Ran 7 tests in 39.621s OK real 0m39.675s user 0…
Could you please also run this benchmark compiled with Cython? Thanks,
Re: PyPy 1.4: Ouroboros in practice
#20>PyPy is a very compliant Python interpreter, almost a drop-in replacement for CPython. What still works in CPython but not PyPy?
Anything that relies on C extensions. Numpy is the biggie for me.