[Tutor] How expensive is a function call

Kalle Svensson kalle@lysator.liu.se
Thu, 23 May 2002 20:09:44 +0200


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

[Arthur Siegel]
> My question then is how much am I losing by this?
> Is the call to the outside function that could to avoided
> in most cases expensive?

Difficult to answer, but generally function calls are expensive in
Python.  The only way to find out for sure is to try both and see
which one is faster, and by how much.

> In the helping people to help themselves - I have been
> intimidated from trying to tackle profiling of performance.
> Is anyone aware of a basic tutorial on this topic?

I found chapter 10 of the Python Library Reference helpful.
http://python.org/doc/current/lib/profile.html

Peace,
  Kalle
- -- 
Kalle Svensson, http://www.juckapan.org/~kalle/
Student, root and saint in the Church of Emacs.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.6 <http://mailcrypt.sourceforge.net/>

iD8DBQE87TBddNeA1787sd0RAvd5AJ9OZvHfNJMRMqwjOOsRaZcWMNsYwwCfVViK
S7bNmrimQ3vw3RvNmRSRLsU=
=P4W7
-----END PGP SIGNATURE-----