[pypy-issue] [issue1414] min()/max() performance

Brian Kearns tracker at bugs.pypy.org
Tue Mar 5 23:34:39 CET 2013


Brian Kearns <bdkearns at gmail.com> added the comment:

Good news-- I was able to improve builtin min/max performance across all sizes 
and also improve speed when key is specified (in b730d41cd8ab). Builtin 
performance is now as good as or better than reduce for size < 10000000. There 
is still some degradation of performance in builtin as size >= 10000000 that 
doesn't happen with reduce, which may very well represent a bug, so leaving 
open.

Previous:
$ ./pypy-c-0 m.py
14277995.64 runs/sec, built-in, size = 10, 50000000 runs
6267714.09 runs/sec, with reduce, size = 10, 50000000 runs
6510680.37 runs/sec, built-in w/ key, size = 10, 50000000 runs

2926269.90 runs/sec, built-in, size = 100, 5000000 runs
3374338.42 runs/sec, with reduce, size = 100, 5000000 runs
843932.29 runs/sec, built-in w/ key, size = 100, 5000000 runs

344833.76 runs/sec, built-in, size = 1000, 500000 runs
563179.64 runs/sec, with reduce, size = 1000, 500000 runs
92365.00 runs/sec, built-in w/ key, size = 1000, 500000 runs

35048.42 runs/sec, built-in, size = 10000, 50000 runs
60476.38 runs/sec, with reduce, size = 10000, 50000 runs
9438.79 runs/sec, built-in w/ key, size = 10000, 50000 runs

3500.86 runs/sec, built-in, size = 100000, 5000 runs
6267.29 runs/sec, with reduce, size = 100000, 5000 runs
934.73 runs/sec, built-in w/ key, size = 100000, 5000 runs

346.31 runs/sec, built-in, size = 1000000, 500 runs
662.96 runs/sec, with reduce, size = 1000000, 500 runs
89.81 runs/sec, built-in w/ key, size = 1000000, 500 runs

29.98 runs/sec, built-in, size = 10000000, 50 runs
67.68 runs/sec, with reduce, size = 10000000, 50 runs
6.99 runs/sec, built-in w/ key, size = 10000000, 50 runs

1.28 runs/sec, built-in, size = 100000000, 5 runs
6.80 runs/sec, with reduce, size = 100000000, 5 runs
0.21 runs/sec, built-in w/ key, size = 100000000, 5 runs

Now:
$ ./pypy-c-3 m.py
21519222.96 runs/sec, built-in, size = 10, 50000000 runs
7251169.03 runs/sec, with reduce, size = 10, 50000000 runs
12548421.16 runs/sec, built-in w/ key, size = 10, 50000000 runs

5091281.99 runs/sec, built-in, size = 100, 5000000 runs
3418216.98 runs/sec, with reduce, size = 100, 5000000 runs
2713657.19 runs/sec, built-in w/ key, size = 100, 5000000 runs

623827.29 runs/sec, built-in, size = 1000, 500000 runs
563213.97 runs/sec, with reduce, size = 1000, 500000 runs
330590.96 runs/sec, built-in w/ key, size = 1000, 500000 runs

62983.00 runs/sec, built-in, size = 10000, 50000 runs
60356.07 runs/sec, with reduce, size = 10000, 50000 runs
34038.98 runs/sec, built-in w/ key, size = 10000, 50000 runs

6398.50 runs/sec, built-in, size = 100000, 5000 runs
6204.26 runs/sec, with reduce, size = 100000, 5000 runs
3410.64 runs/sec, built-in w/ key, size = 100000, 5000 runs

620.88 runs/sec, built-in, size = 1000000, 500 runs
664.87 runs/sec, with reduce, size = 1000000, 500 runs
307.46 runs/sec, built-in w/ key, size = 1000000, 500 runs

47.92 runs/sec, built-in, size = 10000000, 50 runs
68.11 runs/sec, with reduce, size = 10000000, 50 runs
14.86 runs/sec, built-in w/ key, size = 10000000, 50 runs

1.46 runs/sec, built-in, size = 100000000, 5 runs
6.80 runs/sec, with reduce, size = 100000000, 5 runs
0.24 runs/sec, built-in w/ key, size = 100000000, 5 runs

----------
status: resolved -> chatting

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue1414>
________________________________________


More information about the pypy-issue mailing list