Hacker News new | ask | show | jobs
by pvg 5997 days ago
I wonder what you're comparing PHP to. PHP is faster than Ruby and about the same speed as Python. Threading is not a pressing need in the sort of environment PHP typically runs - multiprocess web servers. Python and Ruby, when used for web apps also manage just fine with 'little to no support of multithreading'. And as someone else pointed out, it's not a framework to begin with (although there are PHP frameworks). The language is not without its warts and limitations but I don't think they're the ones you've listed.
1 comments

Let's put the term "framework" aside. The Wikipedia article states it is "a basic conceptual structure used to solve or address complex issues, usually a set of tools, materials or components". I believe a scripting language that is pre-designed for website design could be considered a framework, but it's not that important whether there is a consensus.

I'd like to see your source for the performance claim. To my own I can bring e.g.

http://xodian.net/serendipity/index.php?/archives/27-Benchma...

http://blog.dhananjaynene.com/2008/07/performance-comparison...

I found threading a great shortcoming of PHP. I had web services that required data from several sources and was in need of querying in parallel. there are about 370,000 results for +php +multithreading on Google so I assume it's more than just myself.

The benchmarks you're linking are pretty limited (especially the first one that tests just instantiation and method dispatch). Also synthetic but somewhat more comprehensive -

http://shootout.alioth.debian.org/u32/benchmark.php?test=all...

As I said, if threading is a problem in PHP, it's as much of a problem in Ruby and Python. Common workaround is async message queueing with a great number of solutions available for all of these languages. There's a parallel curl available in recent versions of PHP that covers the simple 'multiple data services' case reasonably well.

You're referring to mcurl. It's an absolute necessity unless you want to shell out extra PHP processes. Still, you have to poll it and the code is not friendly.

Ruby is no gem either (I've always wanted to say that), with the one advantage of having dedicated high-level programmers as advocates within the community.

I haven't seen anything close to RoR or Django in PHP. Nor did I see a Twisted or node.js variant.

Crawling is a problem that is fundamentally different from serving up dynamic websites. I've written a php based crawler framework, it simply uses a database as a central synchronization area and a bunch of parallel scripts to do the crawling.

I could have done the same using curl but for technical reasons chose to do it this way. It's definitely a work around kind of solution though.

I hope to replace the whole thing with a clojure/jvm based solution.