[Zope] python -O

Oleg Broytmann phd@phd.russ.ru
Mon, 1 Nov 1999 17:18:51 +0000 (GMT)


Thanks!

   Short, concise and detaild answer! Excellent!!!

On Mon, 1 Nov 1999, Brian Lloyd wrote:
> >    Question: What are pros and cons to run Zope under "python 
> > -O"? If there are pros, how can I achive that?
> 
> Oleg,
> 
> I suspect that this is because PCGI is not expecting 
> arguments to the Python binary (it uses exec to get
> python started, and it's probably passing the arg
> along as part of the program name).
> 
> If you use the "start" script with Zope 2.x, you can
> add -O there and it seems to work fine - you just can't
> do it if PCGI is starting the process. Note that many
> of the Python command line options have corresponding
> environment variables that can be set as an alternative 
> - if that is the case for the -O option, you should be
> able to set the env. var in your PCGI resource file.
> 
> As far as pros and cons, it may in theory be a little bit
> faster (my limited performance tests using -O didn't show
> much definitive improvement). On the con side, using
> the -O option removes some metadata from Python bytecode
> (line numbers?) which may make it more difficult for you
> to debug a Zope site.

Oleg.
---- 
    Oleg Broytmann      Foundation for Effective Policies      phd@phd.russ.ru
           Programmers don't die, they just GOSUB without RETURN.