Python-cgi or Perl-cgi script doubt

EP EP at zomething.com
Sat Jul 30 03:05:19 EDT 2005


Prabahar wrote:

>        I want to know difference between
> Python-cgi and Perl-cgi and also I want
> to which one is efficient from the performance.


The difference between a cgi program written in Perl and a cgi program written in Python is the choice of programming language.  Both work quite well.  You probably want to use whichever programming language you like best, and that can only be discovered from writing programs in both.

In terms of "efficient"  (efficiency) , are you talking about how much memory the program uses, how fast the program executes, or how much time it takes to write and debug the program?  There are differences between the two in these regards, but I do not have any reliable information that quantifies those differences, and the differences are likely to vary greatly depending on the nature and length of the program, and how efficiently written the code is.

I think, generally, if you really like programming in Perl, there is probably no reason not to use it (at least for typical/short cgi programs) - it has been the default choice for years; conversely, if you really like programming in Python, you will probably be happy to tackle any challenges associated with using it for cgi.


Notes:
Perl cgi execution is generally offered by all hosts that offer cgi; Python cgi execution is offered by fewer hosts (but some of those hosts are really great).

With either language, if execution "performance" is a concern, you may want to use something along the lines of mod_python or mod_perl which embed a persistent interpreter in your web server. This lets you avoid the overhead of starting an external interpreter and avoids the penalty of Perl/Python start-up time, giving faster time to execution.

Was this at all the information you were looking for?  Why do I think you may have intended a very technical question?  If so, you may have to be a little more specific about the sort of differences you are interested in understanding.


Eric





More information about the Python-list mailing list