performance benefits from byte code files?

Aahz Maruch aahz at netcom.com
Fri Jun 16 14:48:01 EDT 2000


In article <8idr3p$33h$1 at nnrp1.deja.com>,
Dan Gindikin  <dan at netrics.com> wrote:
>
>Here an example that motivates this quiestion. Lets say I have a
>relatively large script.py CGI script. Since it is always executed
>directly, a script.pyc file is never generated. Is it then beneficial
>to write a tiny wrapper that does nothing but
>   import script
>   script.run()
>because then script.pyc does get generated?

Yes, it is beneficial.  Usually, it's not a huge time savings unless the
vast majority of your code never gets executed, but it does save the
time of compiling the byte codes.  Note that finding some way other than
CGI of executing the script will likely save even more time (e.g.
FastCGI, mod_python, Zope, and so on).
--
                      --- Aahz (Copyright 2000 by aahz at netcom.com)

Androgynous poly kinky vanilla queer het    <*>     http://www.rahul.net/aahz/
Hugs and backrubs -- I break Rule 6

"The only problem with Microsoft is they just have no taste." --Steve Jobs
(From _Triumph of the Nerds_ PBS special)



More information about the Python-list mailing list