<?xml version="1.0" encoding="utf-8"?>
<article xmlns="http://docbook.org/ns/docbook">
  <section>
    <sectioninfo>
      <abstract>
        <para>Personal homepage of Kore Nordmann. Contains information about his mainly PHP related projects with some political rants in his blog.</para>
      </abstract>
      <author>Kore Nordmann</author>
      <date>Thu, 29 Nov 2007 11:56:05 +0100</date>
      <title>Image_3D performance</title>
      <author>Kore Nordmann</author>
      <date>Thu, 29 Nov 2007 11:56:05 +0100</date>
      <copyright>CC by-sa</copyright>
      <title>Image_3D performance - Kore Nordmann - PHP / Projects / Politics</title>
    </sectioninfo>
    <section>
      <title>Image_3D performance</title>
      <para>The <ulink url="http://www.zend.com/de/products/zend_guard">ZendGuard</ulink> offers optimization and encoding for your PHP code. I visited a friend who ownes a license of ZendGuard so that we had the idea to test it with something CPU intesinve like <ulink url="http://pear.php.net/package/Image_3D">Image_3D</ulink> . The results were quiet surprising.</para>
      <table>
        <tbody>
          <row>
            <entry>
              <para>Rendering times</para>
            </entry>
            <entry>
              <para>PHP 5.1.4</para>
            </entry>
            <entry>
              <para>with APC</para>
            </entry>
            <entry>
              <para>ZendOptimizer</para>
            </entry>
            <entry>
              <para>encoded</para>
            </entry>
            <entry>
              <para>min. optimization</para>
            </entry>
            <entry>
              <para>max. optimization</para>
            </entry>
          </row>
          <row>
            <entry>
              <para>raytracing</para>
            </entry>
            <entry>
              <para>10.48s</para>
            </entry>
            <entry>
              <para>10.40s</para>
            </entry>
            <entry>
              <para>11.10s</para>
            </entry>
            <entry>
              <para>13.35s</para>
            </entry>
            <entry>
              <para>13.30s</para>
            </entry>
            <entry>
              <para>13.30s</para>
            </entry>
          </row>
          <row>
            <entry>
              <para>projection</para>
            </entry>
            <entry>
              <para>0.47s</para>
            </entry>
            <entry>
              <para>0.47s</para>
            </entry>
            <entry>
              <para>0.48s</para>
            </entry>
            <entry>
              <para>0.56s</para>
            </entry>
            <entry>
              <para>0.56s</para>
            </entry>
            <entry>
              <para>0.56s</para>
            </entry>
          </row>
        </tbody>
      </table>
      <para>I was surprised that simply adding the ZendOptimizer to the php.ini caused a performance breakdown by 5%, and encoding the code, with or without optimization increased the performance loss to nearly 30%. I didn't expect a great performance improvement from a bytecode cache, because the parsing is very minor to all the calculations done while raytracing.</para>
      <para>The improvements by <ulink url="http://pecl.php.net/package/APC">APC</ulink> (enabled optimization) are so minimal, that it can be caused by statistical noise. All the times are the mean value of 5 to 10 iterations - the difference was minimal, so that I didn't see the need to test it more often.</para>
      <para>I can understand, that the optimizer does not offer any real improvements, like APC does, but I wouldn't expect such performance impact.</para>
      <section>
        <title>David at 11. May 2006 - 23:32</title>
        <para>We found similar results when we did Zend/ionCube benchmarking in Feb this year - <ulink url="http://www.olate.co.uk/development/benchmarks.php">http://www.olate.co.uk/development/benchmarks.php</ulink></para>
      </section>
    </section>
  </section>
</article>
