Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Performance is no more a curse

Performance is no more a curse

I bet you are writing unit tests for your apps; if not, you probably feel ashamed. But what about performance? Everyone is talking about it but very few people actually integrate performance into their development workflow... After some quick theory, I will show you how to use Blackfire that makes it so easy to profile your apps that you won't have any more excuses anymore for not doing it. Finally, I will talk about my new holy grail: Continuous Performance Profiling.


Romain Neutron

September 15, 2015


  1. Performance is no more a curse
 with RomainNeutron https://www.flickr.com/photos/latitudes/348189242

  2. Romain Neutron 
 Blackfire.io developer
 OpenSource contributor

    https://github.com/romainneutron https://twitter.com/romainneutron
  3. Why Profiling? https://www.flickr.com/photos/latitudes/348189242

  4. https://www.flickr.com/photos/latitudes/348189242 Performance means Resources Less CPU Less Memory Less Network

    Less Servers ...
 Sustainable computing
  5. Performance means Business More repeat business More page views per

    visit Better conversions More revenue Increased user satisfaction ... http://www.slideshare.net/stoyan/the-business-of-performance
  6. abandon a website that takes more than 3 seconds to

    load 40% of users
  7. -100ms +1%
 revenue -2.2s +15%

  8. Performance as a feature https://www.flickr.com/photos/jprovost/5733297977

  9. Profiling Benchmarking Load-testing Monitoring https://www.flickr.com/photos/fallsroad/13240207

  10. Performance?

  11. microtime() https://www.flickr.com/photos/rainriver/6967744353

  12. Instrumentation https://www.flickr.com/photos/dlajholt/4939986995/

  13. Wall Clock Time https://www.flickr.com/photos/guiseiz/6094701062

  14. function foo()
 { bar();
 echo 'foo';
 foo(); Wall-Clock Time

  15. function foo()
 { bar();
 echo 'foo';
 foo(); Inclusive Time

  16. Inclusive Time Critical path of an app

  17. function foo()
 { bar();
 echo 'foo';
 foo(); Exclusive Time

  18. Exclusive Time Find the functions to optimize first

  19. Wall Time = CPU + I/O I/O = Network +

  20. Memory

  21. Call Graph Profiler

  22. The easiest way to profile applications in the development but

    also in the production environment The best visualization tool for interpreting profiling traces for memory, CPU, I/O and for all languages* * Specific extension for PHP, callgrind for other languages
  23. Browser Companion PHP Probe Agent 10/ Upload aggregated profile 1/

    Sign request 2/ Signed request 3/ Create profile 4/ Check signature 5/ Request 6/ Response 7/ Send profile 8/ Continue or stop 9/ Continue or stop Storage 11/ Store
  24. LA DEMO

  25. Continuous Performance

  26. Performance Tests https://www.flickr.com/photos/garrett/2548828323/

  27. # ~/workspace/projet/.blackfire.yml
 "Pages should be fast enough":

 - "main.wall_time < 300ms"
 - "main.memory < 50M"
 - "main.peak_memory < 75M"
 - "main.io < 20ms"
 - "main.cpu_time < 100ms"
 "Pages should not do too many SQL queries":
 path: "/.*"
 - "metrics.sql.queries.count <= 12"
 "Pages should be light":
 path: "/.*"
 - "metrics.output.network_out < 100KB"
 "Pages should not become slower":
 path: "/.*"
 - "percent(main.wall_time) < 10%"
 - "diff(metrics.sql.queries.count) < 2"
  28. # ~/workspace/projet/.blackfire.yml
 "Page should not tag a graph":

    path: ".*"
 - “metrics.process.run.count == 0"
 label: “Run a process"
 layer: ~
 - callee: “=proc_open" Custom Metrics
  29. Try it today! @blackfireio #blackfireio OSLEZMEETUP092015