<?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, 12 Feb 2012 20:13:47 -0600</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Wojciech Sznapka's Blog: Always use most latest versions for benchmarks]]></title>
      <guid>http://www.phpdeveloper.org/news/17452</guid>
      <link>http://www.phpdeveloper.org/news/17452</link>
      <description><![CDATA[<p>
In response to some criticism about his <a href="http://phpdeveloper.org/news/17420">previous post</a> with some framework benchmarks, <i>Wojciech Sznapka</i> has <a href="http://blog.sznapka.pl/always-use-most-latest-versions-for-benchmarks/">posted updated results</a> using the latest versions of each framework.
</p>
<blockquote>
In my previous post Modern framework comparison I presented performance tests, which compared Ruby On Rails, Django and Symfony2. After recieving a feedback in comments I decided to run this benchmark one more time on my own laptop (instead of on my hosting). The reason was simple: enviroment was outdated.
</blockquote>
<p>
There were some overall performance increases were seen, but some statistics were higher - the "time per request" for all of them grew, some by quite a bit. He presents these benchmarks with a caveat, though:
</p>
<blockquote>
You should never choose framework based on benchmarks. Those shows them from one point of view, but there are plenty of other aspects, such as support, community, maturity, number of ready to use components.
</blockquote>]]></description>
      <pubDate>Thu, 26 Jan 2012 10:13:35 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Volker Dusch's Blog: Never trust other peoples benchmarks - A recent example (exceptions)]]></title>
      <guid>http://www.phpdeveloper.org/news/17417</guid>
      <link>http://www.phpdeveloper.org/news/17417</link>
      <description><![CDATA[<p>
In response to a <a href="http://phpdeveloper.org/news/17403">previous post</a> benchmarking exceptions, <i>Volker Dusch</i> has posted <a href="http://edorian.posterous.com/never-trust-other-peoples-benchmarks-a-recent">some of his own thoughts</a> and benchmarking results on the same topic.
</p>
<blockquote>
Some days ago there was a blog post regarding php exception performance in 5.4 and the numbers got reported all over the place. The actually numbers are secondary. The main point is: Don't trust "random" stuff on the Internet when thinking about improving your application performance. You always need to measure things for your self and take care doing so! I've initially trusted the benchmark myself and disgraced the whole post saying: "Well yes, exceptions are slower than if statements but nice that they got faster".
</blockquote>
<p>
He includes some results with a bit more standardized testing - one run with both 5.3 and 5.4 using XDebug and another with it turned off for both. His results make sense, if you think about them:
</p>
<blockquote>
So what we learn from that? Running stuff with debugging tools is slower than not doing that. That's why we don't use xDebug in production.
</blockquote>]]></description>
      <pubDate>Thu, 19 Jan 2012 09:20:32 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Gonzalo Ayuso's Blog: Checking the performance of PHP exceptions]]></title>
      <guid>http://www.phpdeveloper.org/news/17403</guid>
      <link>http://www.phpdeveloper.org/news/17403</link>
      <description><![CDATA[<p>
<i>Gonzalo Ayuso</i> has a new post to his blog today looking at <a href="http://gonzalo123.wordpress.com/2012/01/16/checking-the-performance-of-php-exceptions/">the performance of PHP exceptions</a> and how it could effect your application's overall speed.
</p>
<blockquote>
Sometimes we use exceptions to manage the flow of our scripts. I imagine that the use of exceptions must have a performance lack. Because of that I will perform a small benchmark to test the performance of one simple script throwing exceptions and without them.
</blockquote>
<p>
His (little) benchmarking scripts are included - both looping 100000 times, one throwing an exception and the other not. The results were pretty obvious - the memory usage was about the same but the speed was about ten times faster without the exceptions (in PHP 5.3). In PHP 5.4, however, the numbers were closer as far as time to run. Obviously, unless you make super heavy use of exceptions, you're not even going to come close to something like this (micro-optimization anyone?).
</p>]]></description>
      <pubDate>Tue, 17 Jan 2012 08:02:24 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Nikita Popov's Blog: Disproving the Single Quotes Performance Myth]]></title>
      <guid>http://www.phpdeveloper.org/news/17369</guid>
      <link>http://www.phpdeveloper.org/news/17369</link>
      <description><![CDATA[<p>
In <a href="http://nikic.github.com/2012/01/09/Disproving-the-Single-Quotes-Performance-Myth">this new post</a> to his blog <i>Nikita Popov</i> aims to dispel the popular micro-optimization myth of using single quotes over double quotes for a performance boost.
</p>
<blockquote>
If there is one PHP related thing that I really hate, then it is definitely the Single Quotes Performance Myth. [...] Let's do a random Google search for <a href='https://www.google.com/search?q=php+single+quotes+performance'>"PHP single quotes performance"</a>: <a href='http://stackoverflow.com/questions/482202/is-there-a-performance-benefit-single-quote-vs-double-quote-in-php'>You</a> <a href='http://stackoverflow.com/questions/3316060/single-quotes-or-double-quotes-for-variable-concatenation'>will</a> <a href='http://atomized.org/2005/04/php-performance-best-practices/'>get</a> <a href='https://github.com/fabpot/Twig/issues/407'>many</a> <a href='http://classyllama.com/development/php/php-single-vs-double-quotes/'>results</a> telling you that single quotes are faster than double quotes and that string interpolation is much slower than string concatenation. Most of them advise to use single quotes and concatenation to improve the performance of your application. Let's be clear here: <b>This is pointless.</b>
</blockquote>
<p>
He did some benchmarking of his own to see how the myth would hold up and, as it turns out, it doesn't - "There is none". His proof compares two strings, one normal single-quoted and the other a double-quoted, and the opcodes they generate. They end up exactly the same. Since it's the opcodes that matter, he recommends using something like <a href="http://php.net/manual/en/book.apc.php">APC</a> if you're really worried about the performance. He also includes an example using the <a href="http://php.net/token_get_all">token_get_all</a> function of PHP to see how fast the strings run through the lexer too (again, almost no difference).
</p>
<p>
As an added bonus, he also throws in a bit about string concatenation versus string interpolation with some <a href="http://codepad.viper-7.com/p4aUGN">benchmarking scripts</a> and results of their own.
</p>]]></description>
      <pubDate>Tue, 10 Jan 2012 09:47:55 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Stoimen Popov's Blog: PHP Performance: Bitwise Division]]></title>
      <guid>http://www.phpdeveloper.org/news/17357</guid>
      <link>http://www.phpdeveloper.org/news/17357</link>
      <description><![CDATA[<p>
<i>Stoimen Popov</i> has <a href="http://www.stoimen.com/blog/2012/01/05/php-performance-bitwise-division/">a new post</a> to his blog today comparing the performance of bitwise division versus the normal "/" division operator.
</p>
<blockquote>
Recently I wrote about <a href="http://www.stoimen.com/blog/2011/12/26/computer-algorithms-binary-search/">binary search</a> and then I said that in some languages, like PHP, bitwise division by two is not faster than the typical "/" operator. However I decided to make some experiments and here are the results.
</blockquote>
<p>
According to <a href="http://www.stoimen.com/blog/wp-content/uploads/2012/01/bitwise-divide-by-two.png">his results</a> using the bitwise method is slightly faster, but you'd only really notice it when working with large sets of data (like his example using 10,000,000). The code to run his benchmarks is included in the post.
</p>]]></description>
      <pubDate>Fri, 06 Jan 2012 09:26:38 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPClasses.org: Can .NET make PHP run faster than the official PHP implementation?]]></title>
      <guid>http://www.phpdeveloper.org/news/17263</guid>
      <link>http://www.phpdeveloper.org/news/17263</link>
      <description><![CDATA[<p>
On the PHPClasses blog today the question is posed "<a href="http://www.phpclasses.org/blog/post/168-Can-NET-make-PHP-run-faster-than-the-official-PHP-implementation.html">can .NET make PHP run faster than the official PHP implementation?</a>" (relating to the use of the <a href="http://www.php-compiler.net/">Phalanger</a> tool to compile PHP down to .NET assemblies.
</p>
<blockquote>
Recently Phalanger 3.0 was released introducing numerous improvements in terms of compatibility with the PHP 5.3, interoperability with .NET platform implementations including Mono on Linux, and probably most importantly performance improvements. [...] What motivated this article was that a PHP developer named Rasmus Schultz went on the php.internals mailing list and <a href="http://marc.info/?l=php-internals&m=132338706602251&w=2">proposed</a> to switch the official PHP implementation based on Zend for another based on Phalanger.
</blockquote>
<p>
<a href="http://www.phpclasses.org/blog/post/168-Can-NET-make-PHP-run-faster-than-the-official-PHP-implementation.html">The post</a> includes some benchmarking results of requests made to a WordPress instance running on various PHP platforms. The Phalanger version came in around <a href="http://www.php-compiler.net/wp-content/uploads/2011/08/wordpress-phalanger-201109-performance.png">2 seconds faster</a> (average, obviously) than the PHP FastCGI setup. Also included are two suggestions for future PHP versions (v6 anyone?) that could help the language perform even better: Thread-safety for running with less memory waste and the inclusion of a JIT (Just in time compiler - of which a few are mentioned specifically.
</p>]]></description>
      <pubDate>Thu, 15 Dec 2011 09:03:31 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Robert Basic's Blog: Benchmarking pages behind a login with ab]]></title>
      <guid>http://www.phpdeveloper.org/news/17124</guid>
      <link>http://www.phpdeveloper.org/news/17124</link>
      <description><![CDATA[<p>
<i>Robert Basic</i> has a recent post showing you how to use the "cookie jar" functionality included with Apache's "ab" benchmarking tool to <a href="http://robertbasic.com/blog/benchmarking-pages-behind-a-login-with-ab/">get behind your PHP-based login</a> with a simple curl and grep combo.
</p>
<blockquote>
Tonight I decided to relax a bit and what better way of relaxing is there for a geek then to do some bash scripting?! So for fun and no profit I decided to try and benchmark pages with <a href="http://httpd.apache.org/docs/2.0/programs/ab.html">ab, Apache HTTP server benchmarking tool</a>, which are behind a login. Turns out, it's pretty easy after reading some man pages.
</blockquote>
<p>
He includes an example of the format of the "cookie jar" and the shell script he used to grab the PHP session ID from it and inject it into the "ab" call. The <a href="https://github.com/robertbasic/blog-examples/tree/master/ab-login">script is on github</a>.
</p>]]></description>
      <pubDate>Mon, 14 Nov 2011 10:12:05 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Davey Shafik's Blog: Faster Arrays]]></title>
      <guid>http://www.phpdeveloper.org/news/17091</guid>
      <link>http://www.phpdeveloper.org/news/17091</link>
      <description><![CDATA[<p>
In <a href="http://daveyshafik.com/archives/30320-faster-arrays.html">this new post</a> to his blog <i>Davey Shafik</i> looks at an alternative to the traditional <a href="http://php.net/arrays">arrays</a> most scripts use - something a little faster and more specific: <a href="http://php.net/splfixedarray">SplFixedArray</a>, part of the <a href="http://php.net/spl">Standard PHP Library</a> included with every release.
</p>
<blockquote>
The SplFixedArray class provides a super-fast, fixed size array implementation. There are some limitations however, first you must use numeric keys and secondly you cannot use anonymous assignment (i.e. $array[] = 'value';). You'll notice one requirement was missing, that it should have a fixed size. While having a fixed size is what will bring you the speed increase it's actually not a requirement that the size be fixed.
</blockquote>
<p>
Because of these restrictions, the SplFixedArray is faster than its cousin - between 20 and 40 percent faster, depending on the size of the array. He includes a few snippets in the the post - one showing how he benchmarked the differences against simple arrays and another showing a more advanced example with another SPL type, a <a href="http://php.net/filteriterator">FilterIterator</a>.
</p>]]></description>
      <pubDate>Mon, 07 Nov 2011 08:54:58 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Evert Pot's Blog: iconv_substr vs mbstring_substr]]></title>
      <guid>http://www.phpdeveloper.org/news/16934</guid>
      <link>http://www.phpdeveloper.org/news/16934</link>
      <description><![CDATA[<p>
<i>Evert Pot</i> came across an interesting performance issue as he was working through an application that needed to do some string substitutions - the difference between <a href="http://www.rooftopsolutions.nl/blog/iconv_substr-vs-mbstring_substr">iconv_substr, mb_substr and substr</a>.
</p>
<blockquote>
While working on an application I ran across a huge bottleneck which I isolated down all the way to the use of the iconv_substr function. If you ever wonder which is better to use, [the benchmark code in the post[ should help your decision.
</blockquote>
<p>
His results changed quite a bit from machine to machine (and OS/platform to OS/platform) but one statistic stood out on them all - the <a href="http://php.net/iconv_substr">iconv_substr</a> was slower than <a href="http://php.net/mb_substr">mb_substr</a> method....by a lot in one case (about 2100000% slower).
</p>]]></description>
      <pubDate>Fri, 30 Sep 2011 11:03:20 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Derick Rethans' Blog: Xdebug's Code Coverage speedup]]></title>
      <guid>http://www.phpdeveloper.org/news/16898</guid>
      <link>http://www.phpdeveloper.org/news/16898</link>
      <description><![CDATA[<p>
<i>Derick Rethans</i> has a new post to his blog today talking about some work that's been done to <a href="http://derickrethans.nl/xdebug-codecoverage-speedup.html">speed up XDebug's code coverage generation</a>. Changes in the coming 2.2 release have some improvements that make things perform better and put less stress on PHP in the process.
</p>
<blockquote>
Code coverage tells you how much of your code base is actually being tested by your unit tests. It's a very useful feature, but sadly, it slows down PHP's execution quite a lot. One part of this slowdown is the overhead to record the information internally, but another part is because I have to overload lots of opcodes. (Opcodes are PHP's internal execution units, similar to <a href="http://en.wikipedia.org/wiki/Assembler_%28computer_programming%29#Assembly_language">assembler</a> instructions) They are always overloaded even if code coverage is not used, because it's only safe to overload them for the whole request.
</blockquote>
<p>
These changes were from a combination of <a href="https://github.com/taavi/xdebug/commits/coverage_line_array">contributions from Taavi Burns</a> and a new ini setting that will allow you to enable or disable the code coverage in XDebug. Benchmarking shows a good amount of time reduction in coverage runs - dropping anywhere from a few seconds to over a minute. He also mentions the idea of "modes", shortcuts to predefined settings for different types of reporting (like "profiling" or "tracing").
</p>]]></description>
      <pubDate>Fri, 23 Sep 2011 09:56:33 -0500</pubDate>
    </item>
  </channel>
</rss>

