PHP vs. Python

D

Duncan Booth

Paul said:
I've never heard of any large sites being done in Python, with or
without scaling. By a large site I mean one that regularly gets 100
hits/sec or more. There are many sites like that out there. Those
are the ones that need to be concerned about scaling.

How exactly would you know which large sites are using Python? The PHP
sites tend to advertise their use of PHP by file extensions on every URL,
but a lot of Python sites don't.

I don't know how to tell how many hits a random site has, but there are
certainly some big users out there. For example Viacom uses Zope for many
of its CBS and UPN websites. LastMinute.com, who definitely hit your large
site definition, were working with Zope as well although so far as I know
nothing has yet reached their live site.
 
J

Jon Perez

Anyone know which is faster? I'm a PHP programmer but considering
getting into Python ... did searches on Google but didn't turn much up
on this.

Thanks!
Stephen

If you're talking about usage as a server side scripting
language, then PHP will likely give better page serving
throughput for the same hardware configuration versus
even something that is mod_python based (but I believe
the speed diff would be well under 100%).

However, Python is just so much superior as a language (I
was deep into PHP before I tried out Python and I always hate
having to go back to PHP nowadays in the cases where it is
unavoidable) that you will still want to use Python even if
PHP requires lower server specs to handle the same throughput.

Also, if you have a more complex application for which
pooled variable reuse is an important performance-determining
factor, Python-based server-side scripting solutions might
offer better control of this aspect and may thus yield
superior performance to a PHP-based one.

The real problem with Python is not speed but _availability_.
The number of hosting services out there supporting mod_php
completely outstrips those supporting mod_python. Moreover, they
are significantly cheaper, and offer a lot more features
(Fantastico, etc...). The python-based hosting solutions
out there tend to be dedicated to Python and thus do not
offer these solutions.

If this is not an issue (i.e. you will be running your
own server), then I highly recommend going the Python
route using something like Spyce (which is the closest
thing to PHP in the Python world).
 
J

JZ

Dnia Tue, 28 Dec 2004 02:54:13 +0800, Jon Perez napisa³(a):
If you're talking about usage as a server side scripting
language, then PHP will likely give better page serving
throughput for the same hardware configuration versus
even something that is mod_python based (but I believe
the speed diff would be well under 100%).

I have different experience. When I moved from PHP to Webware
and I compared its performance with (similar scale) php appplications,
my webware was almost 6 times faster! Application servers are always
faster because they use compiled scripts stored in memory. They do not need
to load files from filesystem nor parse them. PHP is faster only for
trivial, useless benchmarks like "Hello world". For bigger code Python is
faster than PHP.
The real problem with Python is not speed but _availability_.

You have rigth here.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top