On 2011-08-21, Andreas L?scher <andreas.loesc...@s2005.tu-chemnitz.de> wrote:
> Am Sonntag, den 21.08.2011, 14:52 -0400 schrieb Roy Smith:
>> In article <mailman.282.1313951079.27778.python-l...@python.org>,
>>  Christian Heimes <li...@cheimes.de> wrote:
>> > I don't think that's the reason. Modern compiles turn a switch statement
>> > into a jump or branch table rather than a linear search like chained
>> > elif statements.

>> This is true even for very small values of "modern".  I remember the 
>> Unix v6 C compiler (circa 1977) was able to do this.

> What is the difference in speed between a jump table that is searched
> from top to bottom

A jump table isn't searched, it's jumped into.  You don't look through the
table for a matching element, you grab the Nth element of the table.

-s
-- 
Copyright 2011, all wrongs reversed.  Peter Seebach / usenet-nos...@seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
I am not speaking for my employer, although they do rent some of my opinions.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to