Dan Sommers wrote: > On Fri, 20 Jan 2006 10:27:58 +1300, > Carl Cerecke <[EMAIL PROTECTED]> wrote:
>>... now you have a function-call overhead on each state transition ... > > > Have you profiled your code and demonstrated that this particular > function call consumes too much time? Yes. For a parser reading a reasonable size input file, the difference is large enough to be noticeable. > If you can't stand the overhead of one [extra, parameterless] function > call per transition, especially *after* having eliminated the numerous > comparisons, then Python may not be the best tool for the job. Maybe. Except the bytecode *is* quite fast enough. There is just no way of writing python code so the compiler can generate that bytecode. Hence the JUMP_ABSOLUTE bytecode rewrite hack. Cheers, Carl. -- http://mail.python.org/mailman/listinfo/python-list