On-topic: alternate Python implementations

Paul Rubin no.email at nospam.invalid
Sat Aug 4 21:38:33 EDT 2012


Steven D'Aprano <steve+comp.lang.python at pearwood.info> writes:
> Runtime optimizations that target the common case, but fall back to 
> unoptimized code in the rare cases that the optimization doesn't apply, 
> offer the opportunity of big speedups for most code at the cost of 
> trivial slowdowns when you do something unusual.

The problem is you can't always tell if the unusual case is being
exercised without an expensive dynamic check, which in some cases must
be repeated in every iteration of a critical inner loop, even though it
turns out that the program never actually uses the unusual case.



More information about the Python-list mailing list