That depends what you consider faster. PHP will save you some q&d hacking time, but Python will save you more in the longer term IMHO. For the other speed, see http://shootout.alioth.debian.org/
stephen.ma...@gmail.com wrote: > Anyone know which is faster? I'm a PHP programmer but considering > getting into Python ...
faster for what? in my experience, people can hack into a PHP site in no time at all, but maybe you meant something else?
(seriously, it depends on what you're doing, of course. and how you're running your programs. and what kind of programs you're writing. and what frameworks you're using. and, and. and, ...)
On 22 Dec 2004 14:03:36 -0800, stephen.ma...@gmail.com
<stephen.ma...@gmail.com> wrote: > 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.
In terms of development, Python is a far better language to write code in[1], has a much more mature standard library[2] and an excellent community[3].
I've avoided your original question. Speed. Python is faster to develop in, and is on-par with execution time. The trick is, with python, you can trivially profile your application and re-write any sections of code that are too slow in C, in pyrex, optimise them with psyco, or just plain fix your efficiency problems.
Profiling in php isn't as easy as import profile profile.run("main()")
Regards, Stephen Thorne.
[1] I have written php commerically for over 3 years. This isn't a subjective look-from-afar. I actually know from down and dirty day-in day-out experience. [2] compare http://pear.php.net to "apt-cache search ^python" [3] Look at http://bugs.php.net/ . There's something fundamentally wrong with a language community where people who have stumbled on honest-to-god bugs are abused.
In article <1103753016.780533.137...@f14g2000cwb.googlegroups.com>,
stephen.ma...@gmail.com wrote: >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.
For web service, the first hurdle is picking which python web interface to use, installing it and (if necessary) configuring your web server to use it. (All that choice is great in many respects, but it does complicate getting started.)
Anyway, once you've done that, i doubt you'll find any speed issues with python, and it is a more pleasant language than PHP. (Unfortunately, that initial hurdle can be a big one; I am still using PHP on my server because I never cleared it.)
Dnia 22 Dec 2004 14:03:36 -0800, stephen.ma...@gmail.com napisa³(a):
> Anyone know which is faster? I'm a PHP programmer but considering > getting into Python ...
Python application servers (Webware, Skunkweb) can work much faster than php. But it is true only for non-trivial code. Benchmark for "Hello world" is a nonsense of course.
But pure speed is not the all. Python can scale better, has cleaner and consistent syntax, better standard libraries and is a common language rather than specific script language for web only.
stephen.ma...@gmail.com wrote: > 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
Is PHP too slow for your needs ? Is that the reason for changing ? If it is, then Python might not satisfy your need. If it isn't, have you thought about why you want to use Python ? If you have, are there greater benefits in total over PHP from what you understand of both PHP and PYthon.
Not sure where you are currently at with your evaluation of Python so if you could outline a few more points on your needs, wants, and expectations it would help when answering your questions about Python.
On Wed, 22 Dec 2004 16:43:21 -0800, Paul Rubin wrote: > JZ <spame...@niet.com> writes: >> But pure speed is not the all. Python can scale better,
> If a system is fast enough on a single processor, it doesn't need to scale.
Your point is circular; "fast enough (right now)" can be defined as "doesn't need to scale (right now)".
For any given server app, enough clients will bog it down. If you're trying to claim that PHP has less trouble with this, I've seen a lot of PHP sites go down under load, so it is clearly not a non-issue.
Python's scaling isn't automatic, it's just easier to do.
Jeremy Bowers <j...@jerf.org> writes: > Your point is circular; "fast enough (right now)" can be defined as > "doesn't need to scale (right now)".
> For any given server app, enough clients will bog it down. If you're > trying to claim that PHP has less trouble with this, I've seen a lot of > PHP sites go down under load, so it is clearly not a non-issue.
> Python's scaling isn't automatic, it's just easier to do.
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.
For sites that get less traffic than that, they only reason they need to scale if they're written in Python is that Python is too slow.