To QUICKLY view performance difference, with and without caching : integrate Tracy - PHP debugger.
- The entire site is interactive, try it.
- Tracy bar shows execution time.
- Explore by fetching random routes with and without cache.
- Delete the cache file to start fresh.
###Tracy debugger stopwatch
( copy paste from github project page )
Another useful tool is the debugger stopwatch with a precision of microseconds:
Debugger::timer();
// sweet dreams my cherrie
sleep(2);
$elapsed = Debugger::timer();
// $elapsed = 2
Multiple measurements at once can be achieved by an optional parameter.
Debugger::timer('page-generating');
// some code
Debugger::timer('rss-generating');
// some code
$rssElapsed = Debugger::timer('rss-generating');
$pageElapsed = Debugger::timer('page-generating');
Debugger::timer(); // runs the timer
... // some time consuming operation
echo Debugger::timer(); // elapsed time in seconds
Debugger::timer();