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

Profiling PHP applications everywhere, all the time

Profiling PHP applications everywhere, all the time

Modern application development involves multiple environments where different states of the code live. The production environment is where the most stable version run, while the staging and development environments host on-going developments. We’ll see how we can continuously profile each environments and how we can catch performance issues before they impact the production system.

Marc Weistroff

July 22, 2019
Tweet

More Decks by Marc Weistroff

Other Decks in Programming

Transcript

  1. blackfire.io @blackfireio #blackfireio In software engineering, software profiling is a

    form of
 
 dynamic program analysis
 
 that measures, for example,
 
 the space (memory) 
 or time complexity of a program,
 or the duration of function calls definition
  2. blackfire.io @blackfireio #blackfireio Bad performance = Bad business Slowness brings

    opportunity cost Cart drop. Conversion rate drop.
 Compare load time to conversion rate and you’ll have a number. example: 1s = ~300K / year in opportunity cost True cost depends of your business. Business Risk
  3. blackfire.io @blackfireio #blackfireio 1. Alice catches a performance issue on

    production 2. Alice pushes a fix. Tests are run. 3. PR is merged & deployed to staging. 4. QA validation process start. 5. Fix is deployed to production. Performance increased 6. Bob wants to refactor Alice’s code, and ruins everything. 7. goto: 1 Classic performance horror story
  4. blackfire.io @blackfireio #blackfireio The cost of this scenario is horrendous

    Opportunity cost
 + development cost
 + review cost
 + bob’s cost
 Performance Economics
  5. blackfire.io @blackfireio #blackfireio Profiling Directly from your terminal: $ blackfire

    curl https://blackfire.io or from the browser with our official extensions for Chrome and Firefox
  6. blackfire.io @blackfireio #blackfireio On-demand All environments: dev/staging/PR/prod Safe for prod:

    0-overhead for non-profiling requests Distributed Profiling ➡ Perfect tool to detect and understand performance issues on a page. Profiling
  7. blackfire.io @blackfireio #blackfireio Our SDK is tightly integrated with PHPUnit

    Run profiling inside your test suite Evaluate metrics on your tested code PHP SDK
  8. blackfire.io @blackfireio #blackfireio Continuous 0-overhead profiling on staging & prod

    User-defined scenarios User-defined performance budgets Monitoring
  9. blackfire.io @blackfireio #blackfireio Scheduled Automated via webhooks Set green/red commit

    status for CI/CD Possible to create complex scenarios Automated Builds
  10. blackfire.io @blackfireio #blackfireio Open-Source Web Crawler / Scraper / Tester

    https://github.com/blackfireio/player Integration tests meet profiling Scenarios
  11. blackfire.io @blackfireio #blackfireio On-demand profiling in every env (prod /

    staging / dev / PR) Performance assertions based on code metrics for unit/integration tests Performance budgets for scenarios Continuous 0-overhead scenario assessment for each environment Incorporate performance management in your whole application development lifecycle
  12. blackfire.io @blackfireio #blackfireio Nobody has stellar performance unless it is

    part of continuous improvement & investment. Start at 95p. Move gradually up. Stop at 98p/99p. Bad performance is a business risk. Act accordingly. Integrate performance in your development lifecycle
  13. blackfire.io @blackfireio #blackfireio Development lifecycle Blackfire makes it easy to

    integrate performance in your application development lifecycle. On-demand profiling, metrics, assertions, continuous profiling, scenarios, distributed profiling, …