<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Sun, 19 May 2013 22:31:33 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Toomas Romer's Blog: Case study: Is PHP embarrassingly slower than Java?]]></title>
      <guid>http://www.phpdeveloper.org/news/10755</guid>
      <link>http://www.phpdeveloper.org/news/10755</link>
      <description><![CDATA[<p>
In a <a href="http://dow.ngra.de/2008/08/04/optimizing-ip2c-php-implementation/">case study</a> posted to his blog, <i>Toomas Romer</i> wonders if a PHP script is embarrassingly slower than than its Java counterpart.
</p>
<blockquote>
The problem. The PHP implementation [of the <a href="http://firestats.cc/wiki/ip2c">IP2C library</a>] 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.
</blockquote>
<p>
He details the script, showing <a href="http://dow.ngra.de/wp-content/uploads/2008/08/vanilla1.png">what parts</a> 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. 
</p>
<p>
He even tries removing the functions and making things a bit more streamlined. This helps, but still lags behind its Java brother. Check out <a href="http://dow.ngra.de/2008/08/04/optimizing-ip2c-php-implementation/">the post</a> for more statistics comparing the two.
</p>]]></description>
      <pubDate>Mon, 04 Aug 2008 12:02:05 -0500</pubDate>
    </item>
  </channel>
</rss>
