I searched on the Web and came to know that PHP code can be compiled to have performance boost. But how to do it? Can I compile both procedural and object oriented PHP code?
But how to do it?
Easy.
First of all you have to do some profiling to be sure that code parsing being a bottleneck of your site, and all other obvious ones like unoptimized data storage, slow algorithms, data mining and network calls were optimized.
Easiest way to determine if you need opcode cache or not would be just putting this line at the very top of your most used page
$timer_start = microtime(1);
and this line at the very end:
echo "Generated in ".(round((microtime(1) - $timer_start),4))." sec.";
if time is more than 0.01
, you have other things to optimize first, because you will notice no effect from opcode cache.