Compiled CGI Python

Assuming the webserver is configured to handle the .exe , can I compile the python CGI file to the exe for speed. What would be the pros and cons for such a depression?

0


a source to share


3 answers


There is py2exe ( and a tutorial on how to use it ), but there is no guarantee that it will make your script faster. It is actually more of an executable interpreter that wraps the bytecode. There are other exe compilers that have different meanings for python code, so you can do a general google search.



However, you can always use psyco to speed up most of the more intensive operations a python script can do, namely looping.

+1


a source


You probably don't want to run Python as CGI if you want fast. Look at proxies, mod_python, WSGI, or FastCGI as these technologies avoid reloading the python executable and your application on every request.



+1


a source


Since the RDBMS and the network are bottlenecks, I see no point in fussing around creating an EXE.

On average, most website transfers are static content (images, .CSS, .JS, etc.) which is best handled by Apache without any Python looping. This has a huge impact.

Reserve Python for the "interesting" and "tricky" parts of creating dynamic HTML. Use a framework.

0


a source







All Articles