<slide title="Benchmarking Results">

<blurb>
So, we have determined we are cpu-bound and we need to go faster.  What can we do?
Some low-hanging fruit:
</blurb>

<example title="include_path" type="shell">
include_path = "/usr/share/pear:."
</example>

<example><![CDATA[<?php
    include './template_helpers.inc';
    include 'business_logic.inc';
?>]]></example>

<example title="open_basedir" type="shell" fontsize="1.75em">
open_basedir = "/usr/share/htdocs/:/usr/share/pear/"
</example>

<blurb>open_basedir checking adds some extra syscalls to every file operation.  It can be useful,
but it is rather expensive, so turn it off if you don't think you need it.</blurb>

<example title="variables_order" type="shell">
variables_order = "GPC"
</example>
<example><![CDATA[<?php
    echo $_SERVER['DOCUMENT_ROOT'];
    echo getenv('DOCUMENT_ROOT'); 
?>]]></example>

<blurb>If you never use cookies, turn those off too</blurb>

<example title="Add an Opcode Cache">
zend_extension=/usr/local/lib/php/20020429/apc.so
apc.enabled=1
apc.shm_segments=1
apc.optimization=0
apc.shm_size=30
apc.num_files_hint=10
apc.gc_ttl=10
apc.mmap_file_mask=/tmp/apc.XXXXXX
apc.filters=
</example>

<table title="Results" columns="3" border="0" width="100%" align="center" fontsize="2.5em">
<cell>156 request/sec</cell><cell>Standard PHP 4.3</cell><cell></cell>
<cell>161 requests/sec</cell><cell>Fix include_path, and only populate GP</cell><cell></cell>
<cell>191 requests/sec</cell><cell>Add IonCube Accelerator on top</cell><cell></cell>
<cell>196 requests/sec</cell><cell>APC no optimizer, IPC shared mem + semaphore locking</cell><cell></cell>
<cell>198 requests/sec</cell><cell>Turck MMCache no optimizer with spinlocks</cell><cell></cell>
<cell>200 requests/sec</cell><cell>APC no optimizer, mmap mem + user space sleep locks</cell><cell></cell>
<cell>202 requests/sec</cell><cell>Turck MMCache with optimizer and spinlocks</cell><cell></cell>
</table>

</slide>
