1 of 19

A Different Vue into Web Performance

Abhijeet Prasad

Software Engineer at Sentry (https://sentry.io)

2 of 19

Agenda

  • How to identify problems
    • Operations
    • Factors that affect performance
    • Influencing factors
  • Measuring data
    • Assets (HTML/CSS/JS)
    • Web Vitals
    • Browser APIs
  • What we do at Sentry

3 of 19

How can we identify performance problems?

4 of 19

What are the operations we care about?

Render a page

  • Pageload
  • Route changes (navigation)

User Interactions

  • Keyboard/Mouse
  • Forms
  • Animations

5 of 19

Inputs

User Hardware

Network Conditions

Backend

Browser

Developer

App Type

Browser Cache

User

CDN/Server Cache

Frontend App Performance

6 of 19

Performance is all about people

  • Front-end operations are fundamentally user based
  • How user’s use your app affects what we care about
  • Response times are affected by human perception [1]
    • 0.1 seconds -> instant reaction
    • 1.0 seconds -> user flow of thought
    • 10 seconds -> keeping user’s attention

[1] https://www.nngroup.com/articles/response-times-3-important-limits/

7 of 19

Get the data

8 of 19

Start measuring stuff

  • Quantitative is the best, but it's actually fine if it's qualitative
  • Gives you an indication of problem
    • Important to understand relative performance
    • Easier to understand possible solutions
  • Guard against regressions
  • Cardinality also matters here (network, hardware, user type)

9 of 19

Measuring asset size

  • Javascript
    • https://github.com/ai/size-limit
    • Webpack bundle analyzer
  • CSS
  • Images/Video/Audio
  • Fonts
  • Other stuff (JSON)

10 of 19

Web Vitals

11 of 19

Google Lighthouse

12 of 19

https://github.com/GoogleChrome/web-vitals/

13 of 19

Other metrics

  • Time to First Byte (TTFB)
  • Time to Interactive (TTI)
  • Total blocking time (TBT)
    • Long Spans API
  • JS Parse time

14 of 19

Distributions matter

  • Use histograms and percentiles
  • Unimodal vs. bimodal
  • Averages don’t tell the whole story
  • Cardinality!

15 of 19

Watch out for LCP

  • LCP is a heuristic, might pick an element that is not important
  • Element Timing API
  • Vue lifecycles

16 of 19

Browser APIs

  • PerformanceEntry
    • Resources
    • Fetch/XHR calls
    • Marks and measures

17 of 19

What we do at Sentry

18 of 19

Thank you!

19 of 19

https://vueschool.io/courses/application-monitoring-in-vue-js-with-sentry