Re: [Python-Dev] new bytecode results

My experience with gcc (on x86) is that it uses a lookup table for contiguous switch statements rather than a long chain of compares/branches. A quick look at the assembler output from ceval.c suggests it's using a lookup table. What architecture did you observe this on? -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/

Andrew McNamara wrote:
Right, but the code for the case implementations itself is ordered (more or less) in the order you use in the C file. At least that was the case at the time (which must have been GCC 2.95.x or even earlier).
What architecture did you observe this on?
Linux. -- Marc-Andre Lemburg eGenix.com Professional Python Software directly from the Source (#1, Feb 28 2003)
Python/Zope Products & Consulting ... http://www.egenix.com/ mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/
Python UK 2003, Oxford: 32 days left EuroPython 2003, Charleroi, Belgium: 116 days left

Andrew McNamara wrote:
Right, but the code for the case implementations itself is ordered (more or less) in the order you use in the C file. At least that was the case at the time (which must have been GCC 2.95.x or even earlier).
What architecture did you observe this on?
Linux. -- Marc-Andre Lemburg eGenix.com Professional Python Software directly from the Source (#1, Feb 28 2003)
Python/Zope Products & Consulting ... http://www.egenix.com/ mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/
Python UK 2003, Oxford: 32 days left EuroPython 2003, Charleroi, Belgium: 116 days left
participants (2)
-
Andrew McNamara
-
M.-A. Lemburg