33 lines
1.0 KiB
Plaintext
33 lines
1.0 KiB
Plaintext
From: greg.ewing at compaq.com (Greg Ewing)
|
|
Date: Wed, 05 May 1999 10:31:10 +1200
|
|
Subject: Python IS slow ! [was] Re: Python too slow for real world
|
|
References: <613145F79272D211914B0020AFF6401914DAD8@gandalf.digicool.com> <p5g15lmb35.fsf@bidra241.bbn.hp.com>
|
|
Message-ID: <372F752E.DD8875E0@compaq.com>
|
|
X-UID: 1723
|
|
|
|
Markus Kohler wrote:
|
|
>
|
|
> From profiling python 1.5.2c I found that python's main problem is that
|
|
> calling functions seems to be very costly.
|
|
|
|
This is just a guess, but one contributor to that might be
|
|
the way that it packs all the arguments up into a tuple,
|
|
and then immediately unpacks them again upon entering
|
|
the function.
|
|
|
|
Also, it allocates each stack frame as a separate object.
|
|
So that's at least two memory allocation/free operations
|
|
per procedure call.
|
|
|
|
A more efficient way would be to use one big stack for
|
|
all procedure calls, and just leave the parameters on
|
|
the stack in the usual case where a procedure with a
|
|
fixed number of arguments is called without any keyword
|
|
args, etc.
|
|
|
|
Greg
|
|
|
|
|
|
|
|
|