News Feed
Jobs Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Toomas Romer's Blog:
Case study Is PHP embarrassingly slower than Java?
August 04, 2008 @ 12:02:05

In a case study posted to his blog, Toomas Romer wonders if a PHP script is embarrassingly slower than than its Java counterpart.

The problem. The PHP implementation [of the IP2C library] is a lot slower. Embarrassingly slower. Without any caching the Java version is able to do ~6000 queries per second. The PHP counterpart can push through ~850 queries. The implementations are the same. The stats provided by the author of the library are 8000 vs 1200. So about the same as my measurements.

He details the script, showing what parts the script is taking up the most time on. A large part of the execution is tied up in IO and the fseek/fread and readShort/readInt functions take up a good chunk.

He even tries removing the functions and making things a bit more streamlined. This helps, but still lags behind its Java brother. Check out the post for more statistics comparing the two.

0 comments voice your opinion now!
casestudy slower ip2c ip country resolution java compare benchmark


blog comments powered by Disqus

Similar Posts

Mike Davies' Blog: PHP Frameworks: comparing CakePHP and symfony

PHPBuilder.com: Object-Oriented Features New To PHP5

Davey Shafik's Blog: Mini-Review: Zend Guard vs IonCube PHP Encoder

Jani Hartikainen's Blog: NetBeans 6.5 review (with PHP support)

IBuildings Blog: PHP Rated Top Scripting Language by Evans Data Corp


Community Events











Don't see your event here?
Let us know!


introduction package composer podcast database framework release language symfony2 series install security facebook unittest performance hhvm opinion application hack component

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework