Message 62589 - Python tracker (original) (raw)
As noted in a posting to python-dev, I've re-evaluated my test methodology. The results are as follows, with details of the PyBench runs in the pybench_summary.txt attachment:
test trunk no-freelists LIFO(500i,100f) case 1 case 2 case 1 case 2 case 1 case 2
pystone 26500 26100 27000 25600 27000 26600 int 1 7.27us 9.09us 6.69us 20.4us 6.64us 9.25us int 2 10.4us 9.48us 20.9us 20.9us 10.5us 9.69us int 3 381us 360us 792us 813us 805us 780us int 4 393us 373us 829us 834us 844us 799us float 1 1.14ms 1.1ms 1.2ms 1.2ms 1.2ms 1.27ms float 2 773us 831us 1.05ms 908us 865us 967us float 3 733us 759us 970us 825us 804us 906us float 4 74.6us 76.9us 100us 83.7us 77.6us 86.9us float 5 7.88ms 8.09ms 10.7ms 8.93ms 8.46ms 9.43ms pybench 16716ms 16666ms 16674ms 16612ms 16612ms 16611ms script a 30.7s 30.6s 33.0s 33.0s 32.3s 32.6s script b 41.7s 40.6s 42.1s 39.4s 40.5s 41.8s
case: 1=std, 2=no small ints
test details
pystone: average of 3 runs
int 1: ./python -m timeit -s "range(1000)" "range(250)"
int 2: ./python -m timeit -s "range(1000)" "range(257,507)"
int 3: ./python -m timeit -s "range(10000)" "range(10000)"
int 4: ./python -m timeit -s "range(11000)" "range(257,10507)"
float 1:
./python -m timeit -s "[float(x) for x in range(1000)]"
"[float(x) for x in range(1000)]"
float 2: ./python -m timeit -s "map(float, range(1000))" "map(float, range(1000))"
float 3: ./python -m timeit -s "t = range(1000)" "map(float, t)"
float 4: ./python -m timeit -s "t = range(100)" "map(float, t)"
float 5: ./python -m timeit -s "t = range(10000)" "map(float, t)"
pybench: average runtime per round of ./python Tools/pybench/pybench.py -f
script a:
import time
def b(time_now=time.clock): limit_val = 2000000 d = [None] * limit_val start_time = time_now() for j in xrange(25): for i in xrange(limit_val): d[i] = i for i in d: d[i] = None return time_now() - start_time
if name == 'main': print 'elapsed: %s s' % b()
script b:
import time
def b(time_now=time.clock): limit_val = 1000000 f = [None] * limit_val d = range(limit_val) start_time = time_now() for j in xrange(25): for i in d: f[i] = float(i) for i in d: f[i] = None return time_now() - start_time
if name == 'main': print 'elapsed: %s s' % b()