Typing system vs. Java

Courageous jkraska1 at san.rr.com
Mon Aug 6 20:27:55 EDT 2001


>Applications whose "performance bottleneck" is _100%_ of their code?!
>Never heard of any such thing.  10% to 20% seems to be common.  What
>counter-examples do you have in mind?

You can get into trouble "externalizing" Python code if you run into a
situation of involving a segment of code which is invoked _frequently_.
In a spot like that, the high-cost of Python method dispatch can be
the limiting factor in your ability to effectively externalize and speed
up your problem.

Note, however, that if you're noticing these kinds of things very often,
you should firmly pat yourself on the back. Since the Python dispatch
overhead is amortized constant, if it becomes the constraining performance
factor in your application, you have optimized out all other complexity
issues of note.

In a situation like this one, it makes sense to have a C or C++ program
which uses Python internally as a scripting engine with some kind of
C-level dispatch which governs whether or not you go to Python. This
gives you the ability to back ALL THE WAY out of Python and escape
the interpreter dispatch cost.

and-its-no-coincidence-that-a-number-of-large-scale-gaming-systems-
do-exactly-this ly yrs wink-wink-wink-dont-punch-me-im-so-cute (1)

C//

(1) isn't Tim fun to pick on? :)




More information about the Python-list mailing list