New submission from Nick Zorin <[email protected]>:
This code works several times slower in PyPy comparing to Python.
import time
def timeit(f):
def timed(*args, **kw):
ts = time.time()
result = f(*args, **kw)
te = time.time()
print 'func:%r args:[%r, %r] took: %2.4f sec' % \
(f.__name__, args, kw, te-ts)
return result
return timed
def fib():
i = 1
a = b = c = 0
while True:
if i == 1:
a = 0
result = a
elif i == 2:
b = 1
result = 2
else:
c = a + b
result = c
a, b = b, c
i += 1
if '31415926' in str(result):
yield i
@timeit
def xxx(f):
f.next()
f.next()
f.next()
f.next()
f.next()
f = fib()
xxx(f)
----------
messages: 5734
nosy: 314l5926, pypy-issue
priority: performance bug
release: 2.0
status: unread
title: Times slower in PyPy
________________________________________
PyPy bug tracker <[email protected]>
<https://bugs.pypy.org/issue1488>
________________________________________
_______________________________________________
pypy-issue mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-issue