Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: Why is function call - recursive especially - in python so slow?

Reply
Thread Tools

Re: Why is function call - recursive especially - in python so slow?

 
 
Terry Reedy
Guest
Posts: n/a
 
      10-19-2004

<> wrote in message
> I'm doing an analysis of program code performance when written in python
> as oppose to other programming languages, and can't seem to figure out
> why
> is the call of functions so slow?


Partly because function parameter definitions and function calls are so
flexible. For instance: named parameters, default values, and *seq and
**dic parameters.

> Is a context being created and stored on stog each time


I do not know whether stog is a type or new word for me. However, I
believe that at present all function calls other than a generator.next
call-after-first-yield do set up a new stack frame. (There has been some
discussion of some reuse in other situations also.)

> How EXACTLY does it work?


The reference manual defines that sematics that any implementation must
implement. 'Exactly' how any particular implemention fulfills that
contract is in the sources.

Terry J. Reedy



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Two recursive calls inside of a recursive function n00m C++ 12 03-13-2008 03:18 PM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
defined? for recursive function call v/s defined? for function call stack Alok Ruby 3 04-13-2006 11:53 AM
Why the following codes is "especially slow" and "unformally slow"? mike Java 3 07-11-2005 05:35 PM
Why is function call - recursive especially - in python so slow? iviskic@uci.edu Python 1 10-18-2004 08:37 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57