5
Internet is lying to you 1. Enable profiler extension… 2. Load the page to profile… 3. Find the resulting profile file… 4. Launch the profile viewer application… 5. Load the profile file in viewer application…
Bullshit.
Slide 6
goal 2
0..2 clicks
Slide 7
7
Low setup, low detail • easy to install • minimal requirements • primarily totals information
Slide 8
8
var_dump() of profiling printf( '%d queries in %.3f seconds, using %.2fMB memory', get_num_queries(), timer_stop( 0, 3 ), memory_get_peak_usage() / 1024 / 1024 ); // 3 queries in 0.251 seconds, using 4.42MB memory
Slide 9
9
Symfony Stopwatch $stopwatch = new Stopwatch(); $stopwatch->start( 'eventName' ); // some code goes here $event = $stopwatch->stop( 'eventName' ); echo $event->getDuration(); // 202 echo $event->getmemory(); // 3670016
symfony.com/doc/current/components/stopwatch
Slide 10
Laps • common load stages • database queries • HTTP requests github.com/Rarst/laps
Slide 11
11
High setup, high detail • (relatively) hard to install • require PHP binary extension • highly detailed information
Slide 12
12
XHProf / uprofiler • open source • lightweight • lingua franca format github.com/FriendsOfPHP/uprofiler
Slide 13
13
Blackfire • in beta • hosted service • nice user interface blackfire.io