classification
Title: ceval cleanup
Type: enhancement Stage: resolved
Components: Versions: Python 3.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, dmalcolm, pitrou, python-dev
Priority: normal Keywords: patch

Created on 2012-10-11 00:04 by benjamin.peterson, last changed 2016-07-18 08:38 by python-dev. This issue is now closed.

Files
File name Uploaded Description Edit
ceval-better.patch benjamin.peterson, 2012-10-11 00:04 review
Messages (5)
msg172610 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2012-10-11 00:04
The attached patch

- Puts every opcode in its own block
- Removes the infamous one variable names "x, v, w, u" and replaces them with local variables.
- forces every opcode to end in DISPATCH() or "goto error"
- cleans up a few minor other things
msg172645 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2012-10-11 14:23
It's a wash:

### call_method_slots ###
Min: 0.437453 -> 0.421975: 1.04x faster
Avg: 0.437604 -> 0.422266: 1.04x faster
Significant (t=331.26)
Stddev: 0.00010 -> 0.00056: 5.3245x larger
Timeline: http://tinyurl.com/9qq9jo4

### call_method_unknown ###
Min: 0.413813 -> 0.425141: 1.03x slower
Avg: 0.413876 -> 0.425304: 1.03x slower
Significant (t=-166.29)
Stddev: 0.00004 -> 0.00084: 19.9809x larger
Timeline: http://tinyurl.com/97pxmh5

### call_simple ###
Min: 0.294412 -> 0.330230: 1.12x slower
Avg: 0.294510 -> 0.330361: 1.12x slower
Significant (t=-1373.15)
Stddev: 0.00029 -> 0.00014: 2.0316x smaller
Timeline: http://tinyurl.com/9qyc4zf

### chaos ###
Min: 0.409597 -> 0.399421: 1.03x faster
Avg: 0.481283 -> 0.400525: 1.20x faster
Significant (t=9.06)
Stddev: 0.06305 -> 0.00040: 158.7104x smaller
Timeline: http://tinyurl.com/8ewhujt

### fannkuch ###
Min: 1.523157 -> 1.477746: 1.03x faster
Avg: 1.528809 -> 1.485938: 1.03x faster
Significant (t=28.48)
Stddev: 0.00759 -> 0.00746: 1.0170x smaller
Timeline: http://tinyurl.com/9k68ek8

### fastunpickle ###
Min: 0.655073 -> 0.674753: 1.03x slower
Avg: 0.658096 -> 0.676514: 1.03x slower
Significant (t=-51.82)
Stddev: 0.00221 -> 0.00119: 1.8605x smaller
Timeline: http://tinyurl.com/94d4zcp

### formatted_logging ###
Min: 0.410074 -> 0.421570: 1.03x slower
Avg: 0.411432 -> 0.423328: 1.03x slower
Significant (t=-39.92)
Stddev: 0.00150 -> 0.00148: 1.0086x smaller
Timeline: http://tinyurl.com/9slusgh

### go ###
Min: 0.759984 -> 0.744335: 1.02x faster
Avg: 0.763061 -> 0.747887: 1.02x faster
Significant (t=35.18)
Stddev: 0.00174 -> 0.00251: 1.4407x larger
Timeline: 7674369812&chco=FF0000,0000FF&chdl=../3.3/python">http://chart.apis.google.com/chart?cht=lc&chs=700x400&chxt=x,y,x,y&chxr=1,0,1.7674369812&chco=FF0000,0000FF&chdl=../3.3/python|../py3k/python&chds=0,1.7674369812&chd=t:0.76,0.76,0.76,0.76,0.76,0.76,0.76,0.76,0.76,0.76,0.76,0.76,0.76,0.76,0.76,0.76,0.76,0.76,0.76,0.77,0.77,0.77,0.76,0.76,0.76,0.76,0.76,0.76,0.76,0.76,0.76,0.76,0.77,0.77,0.76,0.76,0.77,0.76,0.76,0.76,0.76,0.76,0.76,0.76,0.76,0.76,0.77,0.76,0.76,0.76|0.75,0.75,0.75,0.75,0.74,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.76,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.74,0.75,0.75,0.75,0.75&chxl=0:|1|10|20|30|40|50|2:||Iteration|3:||Time+(secs)&chtt=go

### iterative_count ###
Min: 0.154894 -> 0.161959: 1.05x slower
Avg: 0.155405 -> 0.162507: 1.05x slower
Significant (t=-136.59)
Stddev: 0.00030 -> 0.00022: 1.3638x smaller
Timeline: 16293883324&chco=FF0000,0000FF&chdl=../3.3/python">http://chart.apis.google.com/chart?cht=lc&chs=700x400&chxt=x,y,x,y&chxr=1,0,1.16293883324&chco=FF0000,0000FF&chdl=../3.3/python|../py3k/python&chds=0,1.16293883324&chd=t:0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.15,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.15,0.16,0.16,0.16,0.16,0.16|0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16,0.16&chxl=0:|1|10|20|30|40|50|2:||Iteration|3:||Time+(secs)&chtt=iterative_count

### json_dump_v2 ###
Min: 3.656729 -> 3.876189: 1.06x slower
Avg: 3.690897 -> 3.887980: 1.05x slower
Significant (t=-109.27)
Stddev: 0.01121 -> 0.00607: 1.8460x smaller
Timeline: 65672922134,4.89833188057&chco=FF0000,0000FF&chdl=../3.3/python">http://chart.apis.google.com/chart?cht=lc&chs=700x400&chxt=x,y,x,y&chxr=1,2.65672922134,4.89833188057&chco=FF0000,0000FF&chdl=../3.3/python|../py3k/python&chds=2.65672922134,4.89833188057&chd=t:3.7,3.68,3.69,3.7,3.7,3.67,3.68,3.67,3.67,3.69,3.7,3.69,3.69,3.69,3.7,3.7,3.69,3.69,3.7,3.69,3.69,3.7,3.69,3.69,3.69,3.69,3.7,3.7,3.69,3.7,3.71,3.69,3.68,3.7,3.69,3.7,3.7,3.69,3.7,3.7,3.69,3.7,3.71,3.7,3.69,3.69,3.69,3.66,3.67,3.66|3.88,3.89,3.9,3.9,3.89,3.89,3.89,3.89,3.89,3.89,3.88,3.89,3.89,3.88,3.9,3.89,3.89,3.9,3.89,3.9,3.9,3.89,3.9,3.9,3.89,3.89,3.88,3.88,3.88,3.88,3.88,3.88,3.89,3.89,3.88,3.88,3.89,3.88,3.88,3.89,3.88,3.88,3.89,3.88,3.88,3.89,3.89,3.88,3.88,3.88&chxl=0:|1|10|20|30|40|50|2:||Iteration|3:||Time+(secs)&chtt=json_dump_v2

### json_load ###
Min: 0.546481 -> 0.568681: 1.04x slower
Avg: 0.547893 -> 0.569776: 1.04x slower
Significant (t=-155.12)
Stddev: 0.00086 -> 0.00050: 1.7270x smaller
Timeline: 57190203667&chco=FF0000,0000FF&chdl=../3.3/python">http://chart.apis.google.com/chart?cht=lc&chs=700x400&chxt=x,y,x,y&chxr=1,0,1.57190203667&chco=FF0000,0000FF&chdl=../3.3/python|../py3k/python&chds=0,1.57190203667&chd=t:0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.55|0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57,0.57&chxl=0:|1|10|20|30|40|50|2:||Iteration|3:||Time+(secs)&chtt=json_load

### nbody ###
Min: 0.333188 -> 0.349242: 1.05x slower
Avg: 0.333758 -> 0.350291: 1.05x slower
Significant (t=-179.88)
Stddev: 0.00041 -> 0.00050: 1.2323x larger
Timeline: 35260510445&chco=FF0000,0000FF&chdl=../3.3/python">http://chart.apis.google.com/chart?cht=lc&chs=700x400&chxt=x,y,x,y&chxr=1,0,1.35260510445&chco=FF0000,0000FF&chdl=../3.3/python|../py3k/python&chds=0,1.35260510445&chd=t:0.34,0.34,0.33,0.33,0.33,0.33,0.33,0.33,0.33,0.33,0.33,0.33,0.33,0.33,0.33,0.33,0.33,0.33,0.33,0.33,0.33,0.33,0.33,0.33,0.33,0.33,0.33,0.33,0.33,0.33,0.33,0.33,0.33,0.33,0.33,0.33,0.33,0.33,0.33,0.33,0.33,0.33,0.33,0.33,0.33,0.33,0.33,0.33,0.33,0.33|0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35&chxl=0:|1|10|20|30|40|50|2:||Iteration|3:||Time+(secs)&chtt=nbody

### pathlib ###
Min: 0.144972 -> 0.148708: 1.03x slower
Avg: 0.145470 -> 0.149212: 1.03x slower
Significant (t=-119.94)
Stddev: 0.00043 -> 0.00024: 1.8258x smaller
Timeline: 15072345734&chco=FF0000,0000FF&chdl=../3.3/python">http://chart.apis.google.com/chart?cht=lc&chs=700x400&chxt=x,y,x,y&chxr=1,0,1.15072345734&chco=FF0000,0000FF&chdl=../3.3/python|../py3k/python&chds=0,1.15072345734&chd=t:0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15|0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15&chxl=0:|1|17|34|51|68|84|2:||Iteration|3:||Time+(secs)&chtt=pathlib

### raytrace ###
Min: 1.834003 -> 1.771301: 1.04x faster
Avg: 1.837693 -> 1.776832: 1.03x faster
Significant (t=140.03)
Stddev: 0.00200 -> 0.00234: 1.1713x larger
Timeline: 771300792694,2.84174513817&chco=FF0000,0000FF&chdl=../3.3/python">http://chart.apis.google.com/chart?cht=lc&chs=700x400&chxt=x,y,x,y&chxr=1,0.771300792694,2.84174513817&chco=FF0000,0000FF&chdl=../3.3/python|../py3k/python&chds=0.771300792694,2.84174513817&chd=t:1.84,1.83,1.84,1.84,1.84,1.84,1.84,1.84,1.83,1.84,1.84,1.84,1.84,1.84,1.84,1.84,1.84,1.83,1.84,1.84,1.84,1.83,1.84,1.84,1.84,1.84,1.84,1.84,1.84,1.84,1.84,1.84,1.84,1.84,1.84,1.84,1.84,1.84,1.84,1.84,1.84,1.83,1.84,1.84,1.84,1.83,1.84,1.84,1.84,1.84|1.78,1.77,1.78,1.77,1.77,1.78,1.77,1.77,1.77,1.78,1.78,1.78,1.77,1.78,1.78,1.78,1.78,1.78,1.78,1.77,1.78,1.78,1.78,1.78,1.78,1.78,1.78,1.78,1.78,1.78,1.78,1.78,1.78,1.78,1.78,1.78,1.78,1.78,1.78,1.78,1.78,1.78,1.78,1.78,1.78,1.78,1.78,1.78,1.78,1.77&chxl=0:|1|10|20|30|40|50|2:||Iteration|3:||Time+(secs)&chtt=raytrace

### richards ###
Min: 0.228433 -> 0.239748: 1.05x slower
Avg: 0.230110 -> 0.242057: 1.05x slower
Significant (t=-46.57)
Stddev: 0.00092 -> 0.00156: 1.6980x larger
Timeline: 24749755859&chco=FF0000,0000FF&chdl=../3.3/python">http://chart.apis.google.com/chart?cht=lc&chs=700x400&chxt=x,y,x,y&chxr=1,0,1.24749755859&chco=FF0000,0000FF&chdl=../3.3/python|../py3k/python&chds=0,1.24749755859&chd=t:0.23,0.23,0.23,0.23,0.23,0.23,0.23,0.23,0.23,0.23,0.23,0.23,0.23,0.23,0.23,0.23,0.23,0.23,0.23,0.23,0.23,0.23,0.23,0.23,0.23,0.23,0.23,0.23,0.23,0.23,0.23,0.23,0.23,0.23,0.23,0.23,0.23,0.23,0.23,0.23,0.23,0.23,0.23,0.23,0.23,0.23,0.23,0.23,0.23,0.23|0.24,0.24,0.24,0.24,0.24,0.24,0.24,0.24,0.24,0.24,0.24,0.24,0.24,0.25,0.24,0.25,0.24,0.24,0.24,0.24,0.24,0.24,0.24,0.24,0.24,0.24,0.24,0.24,0.24,0.24,0.24,0.24,0.24,0.24,0.24,0.24,0.24,0.24,0.24,0.24,0.24,0.25,0.24,0.24,0.24,0.24,0.24,0.24,0.24,0.24&chxl=0:|1|10|20|30|40|50|2:||Iteration|3:||Time+(secs)&chtt=richards

### spectral_norm ###
Min: 0.472338 -> 0.394497: 1.20x faster
Avg: 0.473632 -> 0.395272: 1.20x faster
Significant (t=430.86)
Stddev: 0.00109 -> 0.00068: 1.6172x smaller
Timeline: 4786093235&chco=FF0000,0000FF&chdl=../3.3/python">http://chart.apis.google.com/chart?cht=lc&chs=700x400&chxt=x,y,x,y&chxr=1,0,1.4786093235&chco=FF0000,0000FF&chdl=../3.3/python|../py3k/python&chds=0,1.4786093235&chd=t:0.47,0.48,0.47,0.48,0.48,0.47,0.48,0.47,0.47,0.47,0.47,0.47,0.47,0.47,0.47,0.47,0.47,0.47,0.47,0.47,0.47,0.47,0.47,0.47,0.47,0.47,0.47,0.47,0.47,0.47,0.47,0.47,0.47,0.47,0.47,0.47,0.47,0.47,0.47,0.47,0.48,0.47,0.47,0.47,0.47,0.47,0.47,0.47,0.47,0.47|0.39,0.39,0.4,0.39,0.4,0.39,0.39,0.4,0.39,0.39,0.4,0.4,0.4,0.4,0.4,0.4,0.4,0.4,0.4,0.4,0.4,0.4,0.4,0.4,0.4,0.4,0.39,0.4,0.39,0.39,0.4,0.4,0.39,0.4,0.39,0.4,0.39,0.4,0.4,0.4,0.39,0.4,0.39,0.39,0.39,0.4,0.39,0.39,0.4,0.4&chxl=0:|1|10|20|30|40|50|2:||Iteration|3:||Time+(secs)&chtt=spectral_norm

### threaded_count ###
Min: 0.147395 -> 0.155172: 1.05x slower
Avg: 0.151059 -> 0.162784: 1.08x slower
Significant (t=-5.57)
Stddev: 0.00379 -> 0.01439: 3.7929x larger
Timeline: http://tinyurl.com/96wgctd
msg172742 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2012-10-12 13:21
I won't examine the patch in detail, but the cleanup is welcome and I trust you (and the test suite :-)) that it works fine.
msg172752 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-10-12 15:35
New changeset ac30a1b1cf17 by Benjamin Peterson in branch 'default':
ceval cleanup
http://hg.python.org/cpython/rev/ac30a1b1cf17
msg270727 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-07-18 08:38
New changeset 6cf4386de3cc by Martin Panter in branch '3.5':
Issue #16191: Fix up references to renamed variables
https://hg.python.org/cpython/rev/6cf4386de3cc

New changeset c10fe99afced by Martin Panter in branch 'default':
Issue #16191: Merge comment fixes from 3.5
https://hg.python.org/cpython/rev/c10fe99afced
History
Date User Action Args
2016-07-18 08:38:52python-devsetmessages: + msg270727
2012-10-12 17:00:29dmalcolmsetnosy: + dmalcolm
2012-10-12 15:35:03python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg172752

resolution: fixed
stage: resolved
2012-10-12 13:21:42pitrousetnosy: + pitrou
messages: + msg172742
2012-10-11 14:23:26benjamin.petersonsetmessages: + msg172645
2012-10-11 00:04:55benjamin.petersoncreate