PROACTIVE

PERFORMANCE BUDGETS

IN A CI/CD WORLD

Alfredo Lopez

👋 Hi, I'm Alfredo

Artboard Created with Sketch.

The Performance Battle

Continuous

Integration / Delivery

Automation

Pull Request

Run Tests

Merge

It's Live!

Deploy with Confidence

Artboard Created with Sketch.

Up to 15 daily

production deploys

"Why not more?"

INFRA

STRUC

TURE

Pull Request Performance Integration?

lighthousebot

sitespeed.io

The Problem

  • Single URL.

  • Run and block the build process.

  • No consolidated reports.

Lightkeeper

Maintain Lighthouse Budgets in Pull Request URLs.

...Any Github Check Run, Deployment or Status

{
  "routes": [
    "/article/1/",
    {
      "url": "gallery/1",
      "settings": "galleries"
    },
    {
      "url": "gallery/2",
      "settings": {
        "extends": "galleries",
        "categories": {
          "pwa": {
            "target": 80
          }
        }
      }
    }
  ]
}

Try it out!

Netlify Build Functions

module.exports = {
    async finally() {
        console.log('Preparing to trigger Pull Request tests');
    }
}

Netlify Speed Curve Plugin

build:
  # this is basic configuration stuff telling
  # netlify where to publish to and what command
  # to run to build the site
  publish: dist
  lifecycle:
    build:
      - eleventy
plugins:
  # here's where we pull in the plugin
  speedcurveDeploy:
    type: ./plugins/netlify-plugin-speedcurve-deploy

Calibre

Lighthouse CI

Lighthouse CI - Multiple URL Matrix

{
  "assertMatrix": [
    {
      "matchingUrlPattern": ".*",
      "assertions": {
        "first-contentful-paint": ["warn", {"maxNumericValue": 2000}]
      }
    },
    {
      "matchingUrlPattern": "https://[^/]+/app",
      "assertions": {
        "interactive": ["warn", {"maxNumericValue": 5000}]
      }
    }
  ]
}

Zeit?

Surface what matters

  • Don't make us go to a dashboard to to see why something failed.

  • Don't clutter the shared workspace if nothing is wrong.

"We came up with the notion that not all web pages are created equal. People are – but not web pages."

Pull Request Tests

only solves part of

the challenges in CI/CD.

Performance Dies by a Thousand Cuts

PR #123

PR #456

PR #789

3kb

3kb

3kb

PR #100

3kb

Predicting Regressions

What if....

all Pull Requests...

that can be merged...

get deployed today?

Spotter CI

Spotter CI

Collect all open PRs daily

with labels E.g

"Ready to Merge"

PR #123

PR #456

PR #789

Merge into a temp branch

PR #101

Open PR

and assign users

from a config value

We should be supported by our tools, not challenged.

TLDR

Thanks for listening!

Proactive Performance Budgets

By Alfredo Lopez

Proactive Performance Budgets

What If...All your Pull Requests...that can be merged...get deployed...today? Could you predict your performance improvements or regressions?

  • 730