State of Loading
2017 2018
KenjiBaheux@, Kinuko@ + team
BlinkOn 8
September 20-21st 2017
Goal of This Presentation
Make it righter
What is Loading?
Navigating
Loading
Interacting
Loading
L
L
Response
Animation
A
R
R
L
L
This is Loading
time
Launching
Startup
Navigating
Loading
...
Web platform viewpoint
When is Loading
Great?
With First Paint at 2s
With Meaningful Paint at 4s
Time To Consistently Interactive
User Happiness
1s
10s
2s
3s
4s
With First Paint at 2s
Loading’s Vanishing
Act
What to Focus on?
PWA & NBU
Progressive Web Apps
Naturally better user experiences
World Map of Internet Connected Devices (2012!)
Next Billion Users
Poor Loading user experience
because of slow/flaky networks
Well-Lit and Approachable Path
Photo by Richard Schneider
Problem Statement,
Achievements and Plan: 2017+
Loading today does not scale!�
Want to provide delightful loading experience for rich, modularized, progressive Web applications,
HOWEVER
Our bigger theme in 2017: Scalable Loading
What’s Missing: 2017 Version
Our Focus in 2017
Our Focus in 2017
Expressive Primitives
Streams API: How streams composition could work
Readable
Writable + Readable
Writable
pipeTo()
pipeTo()
async function fetchDirectlyIntoDOM() {� const response = await fetch('catnames', ...);� await response.body� .pipeThrough(new TextDecoder())� .pipeTo(targetDiv.writable);
}
This is just an example. Not yet Implemented
Expressive Primitives: What’s coming Next?
We can’t work on many at once / want to work on what’s really needed, so your input is really appreciated!
ES6 Modules
ES6 Modules: What’s coming Next?
import("./optional-feature.js")� .then((m) => m.activate());
Our Focus in 2017
Service Worker Optimizations: Where’s the cost?
Major bottlenecks:
Startup-cost hurts no-op Service Worker latency, which tends�to make developers hold off
Service Worker Optimizations
Roadmap: bit.ly/2xaybOc
Chunking and Yielding between Content Script runs
time
Before
Extension 1
Ext 2
3
4
Ext 5
User action
Response
User action
time
After
Extension 1
Ext 2
3
4
Ext 5
User action
Response
User action
content_script for all extensions used to run in one task [ JANK] �→ chunk it into multiple tasks asyncly!
Count
Duration of content script run (ms)
Before
After
# of content script runs leading to Jank
less Jank caused by extensions
~30%
Canary/Dev numbers
Beta experimenting starting
Chunking and Yielding between Content Script runs
Background Tab Throttling
From our in-lab local measurements (not from real world!):
Potential win for faster FMP and less OOM
if we throttle non-critical loading?
Background Tab Throttling
Our Focus in 2017
Re-architecturing Loading Pipeline
Re-architecturing Loading Pipeline
Shipped:
In-progress & Planned:
Scheduling optimization
+Mojo-loading
Time To First Contentful Paint (median)
Baseline
% faster
Status:
Unified Web Security Logic (CORS / CSP / MIX)
CORS
CSP
MIX
Fetch
Background
Fetch
Navigation
Expect-CT
ServiceWorker
Re-architecturing Loading Pipeline
Roadmap & more details:
https://docs.google.com/document/d/10yFcHyq4ddheoJrEmyLMnCkzYvI7ioayPwH4ivDXTwg/preview
Done
(re)Considering
(talk to lassey@ or kenjibaheux@)
HTTP/2
In progress
From There...
(e.g. Fetch Priority, Ways to take care of the hard things with Loading).
(e.g. let you use ES6 modules as-is).
Tentative Goals for 2018
Thank You