[pypy-issue] Issue #1931: slower factorial compared to CPython (pypy/pypy)

Philip Nguyen issues-reply at bitbucket.org
Thu Nov 20 21:57:22 CET 2014

New issue 1931: slower factorial compared to CPython

Philip Nguyen:

The following program runs slower with PyPy than CPython on my computer:


import time

def prod(n):
    p = 1
    for i in range(1, n + 1):
        p *= i
    return p

start = time.time()
end = time.time()
print "prod: %s" % (end - start)

`PyPy 2.3.1` takes **3.5s**, while `CPython 2.7.8` takes **2.8s**. This is `Ubuntu 14.10 64bit` on `Core i7 3667U`.

More information about the pypy-issue mailing list