GithubHelp home page GithubHelp logo

googlechromelabs / discovery Goto Github PK

View Code? Open in Web Editor NEW
175.0 37.0 11.0 6 KB

Discoveries on Sustainable Loading research

License: Other

performance loading webpagetest v8 webperf parse compile interactive

discovery's Introduction

discovery

Discoveries learned exploring Sustainable Loading for the web.

discovery-logo-compressed

What is the Sustainable Loading project?

Modern Web applications load code and data. Loading and processing (parsing, evaluating etc.) this data is not free, and negatively impacts the RAIL of the application. Further, as the apps become more complex, the code/data loading demands increase, and so does their impact. The impact becomes critical on mobile devices, leading to terrible user experience, unhappy users and developers.

Sustainable Loading is an initiative in Chrome to solve the problem of scalably loading complex applications with minimal impact on RAIL by giving developers the right tools, primitives, and narrative.

discovery's People

Contributors

addyosmani avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

discovery's Issues

Data-set: Sites representative of popular JavaScript loading patterns

Requirements:

  • Ordered by Alexa ranking
  • Optionally use Webpack (check Webpack JSON signature)
  • Optionally look at RequireJS usage. Is code bundled with it still being deployed?
  • Optionally use Browserify (separate run)
  • Have first-party JS where they're shipping more than 1 x JS file (separate run)

Who wanted this?
V8

Data-set: Highly ranked Progressive Web Apps

Why?

This may be useful to help understand whether the presence of a Service Worker helps improve code caching in V8 given the heuristics are far easier to trigger when SW is present and scripts are stored from Cache Storage.

Just need to generate the list of sites and V8 can take on benchmarking from there.

Production Web Apps Performance Study Q4/16 - Q1/17

Goals

  • Understand the cost of JS Parse/Compile/FunctionCall times on apps
  • Discover how quickly apps become interactive on average mobile hardware
  • Learn how much JavaScript apps are shipping down on desktop + mobile

Sample information
6000+ production sites using one of React, Angular 1.0, Ember, Polymer, jQuery or Vue.js. Site URLs were obtained from a combination of Libscore.io, BigQuery, BuiltWith-style sites, framework wikis. Sample sets were 10% eye-balled to verify usage of frameworks. Sets not reliable were discarded from the final study.

URLs: https://docs.google.com/a/google.com/spreadsheets/d/1_gqtaEwjoJGbekgeEaYLbUyR4kcp5E7uZuMHYgLJjGY/edit?usp=sharing

Trivia: All in all, 85,000 WebPageTest results were generated as part of this study. Yipes.

Tools used in study
WebPageTest.org (with enhancements such a JS cost, TTI, aggregated V8 statistics added thanks to Pat Meenan as the project progressed), Catapult (internal Google tool), Chrome Tracing.

Summary observations

metrics comparison

breakdowns

mobile-desktop-stury

screen shot 2017-02-06 at 5 19 56 pm

This data may be useful to developers as it shows:

  • Real, production apps using their favorite stacks can be much more expensive on mobile than they might think.
  • Closer attention to lower parse times and time-to-interactive points is likely required if you're choosing something off the shelf.
  • Some, but not all, apps are shipping larger bundles. Where this is the case invest in code-splitting & reducing how much JS is used.

Where are the medians and aggregates?

The primary goals of this study were to highlight trends looking at the different data-sets available to me as a whole. Initially, I focused on summarizing this data at a per-framework level (e.g React apps in set 1 exhibited characteristic A). After reviewing this with the Chrome team, we decided presenting per-framework breakdowns were more susceptible to the takeaway being "oh, so I should just use framework X over Y because it is 2% better" instead of the important takeaways about parse/compile being a problem we all face.

To that end, the below charts are generated locally by fetching each of the WebPageTest reports for data-sets, iterating over a particular dimension (e.g Time-to-interactive, JS parse time) and getting the medians for different sets that are then plumbed into either Google Sheets or Numbers for charting. If you wish to recreate that setup yourself, you can grab the CSVs from the below reports.

Raw WebPageTest runs - Round 2 (January, 2017)

Raw WebPageTest runs - Round 1 - Older study (December, 2016)

I put together this graphic when internally sharing the first version of this study. I decided to redo it as at least the network throttling setup from this study wasn't the same between the 2-3 web perf tooling systems used. This meant that while overall weight, time in script (parse/eval), FMP and load time were fine, the TTI numbers could not be concretely confirmed as 100% accurate. Instead, I redid the study once we added support for TTI to WebPageTest and I'd trust the numbers there (Round 2) a lot more.

screen shot 2016-12-12 at 9 18 38 am

Other data sets generated (Dec, 2016)

Note: many of the below data sets were generated before we installed Moto G4s in WebPageTest and had to use the Moto G1 instead. Some of the data sets will also be using earlier versions of the time-to-interactive metric and should not be directly compared in most cases to the latest data from 2017. This is historical data that's interesting and may be worth reexploring where particular data-sets didn't end up making it to the final study results.

What is the 1st-party vs 3rd-party breakdown of sites with worst TTCI?

For sites with the worst time to consistently interactive, what percentage of these sites are loading JS from a first party origin ("site/app code") vs third party (maybe ads, widgets)?

This one may not be possible to compute without a change in Lighthouse that includes the 1st vs 3p breakdown. It may also be something we can calculate using WPT if we can figure out how to get the joins right.

Sites with the highest time-to-consistently interactive

Sample query from Rick:

SELECT
  JSON_EXTRACT(report, "$.audits.consistently-interactive.rawValue") AS ttci,
  JSON_EXTRACT(report, "$.audits.first-interactive.rawValue") AS ttfi,
  JSON_EXTRACT(report, "$.audits.first-meaningful-paint.rawValue") AS fmp
FROM
  [httparchive:har.latest_lighthouse_mobile]

How stable are the TTFI and TTCI metrics?

This may provide data on overall confidence of the metrics.

Stability can be aggregate changes from run to run. We could measure the variance with the idea that if two runs were close in time together we would hope variance is low. Some sites will change. Some will have low variance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.