> I was running Spyce in CGI mode and it was quite slow. Today I
> decided that I should install mod_python.
Yup, CGI is a pig. You need to start a new process, load up the Python
executable, load and parse the Spyce script codebase, run the engine
initialization, read the Spyce file, compile the Spyce file and finally
execute it. It's not surprising that you don't get more than a few hits per
second this way. :)
> Spyce created a comented out section in httpd.conf for mod_python,
> but it has a small problem. The PythonPath directive expects one
> parameter enclosed in double quotes but the generated one did
> have such thing.
> So, this directive should be changed from:
> PythonPath sys.path+[r'D:/Program Files/spyce']
> PythonPath "sys.path+[r'D:/Program Files/spyce']"
Hmmm... All these different configurations are going to kill me. :) I
thought that I used to have quotes and that there was some reason that I
took them off, but having just checked the CVS I see that's not the case.
I'll test it on my system, change it in the next release if there are no
problems, and see if anyone else on this list thinks the opposite.
> Also, what is the purpose of the other two directives (i have
> them comented out):
> # #PythonOption SPYCE_CONFIG "/mydir/spyce.conf"
> # # !!! Do NOT turn on. !!!
> # PythonOptimize Off
They are commented out by default. I guess they need more documentation. The
first of the two can direct the Spyce engine to read a configuration file
that can contain a few options. This is simlar to the --conf command-line
option. The command-line options are:
and the description of the configuration file is at:
The second line determines whether the Python interpretter that mod_python
starts is placed in optimize mode or not. This is equivalent to the
Python -OO command-line switch. The reason that Spyce can NOT be run under
optimize mode is because under optimize mode the interpretter eliminates
documentation strings. Spyce uses a parser generator tool that depends on
the existence of documentation string. Despite the name "optimize", this
mode does not seem to currently do very much in terms of performance, so I'm
not too concerned.
I hope that helps.
All the best,