Concerns about performance w/Python, Pysco on Pentiums
Michael Hudson
mwh at python.net
Thu Mar 6 11:51:57 EST 2003
"Anders J. Munch" <andersjm at dancontrol.dk> writes:
> You were switching by means of a dict of functions, right? An elegant
> and natural Python solution, but my bet is that psyco can't see
> through it.
>
> Try replacing the dict with a long if-elif-elif-elif-chain ordered by
> expected execution frequency. Or better yet, a tree of if statements
> performing an inlined binary search, if you don't mind the
> maintenance.
You might also try a list of functions rather than a dict. I think
psyco knows more about lists than dicts. But ICBW.
Cheers,
M.
--
My hat is lined with tinfoil for protection in the unlikely event
that the droid gets his PowerPoint presentation working.
-- Alan W. Frame, alt.sysadmin.recovery
More information about the Python-list
mailing list