1 Waiting in line at retail store Watching a melodramatic TV show Standing at the edge of a virtual cliff Watching a horror movie Experiencing mobile delays Solving a math problem Source (2015): https://goo.gl/8v7bRG The level of stress caused by mobile delays was comparable to watching a horror movie Cognitive load associated with stressful situations
per origin Firefox - 10% of free disk space (shared across eTLD+1) Safari - at least 10% of free disk space Edge - <8GB: 10MB 8GB-32GB: 50MB 32GB-128GB: 250MB >128GB: 500MB
reg.pushManager.subscribe(opts) .then(function (sub) { console.log('Update Server with sub obj', sub); updateServerWithSubscription(sub); }) .catch(function (error) { console.log('Unable to subscribe user', error); }); }); Subscribe the User
console.log('Update our server to remove subscription'); } }); }).catch(function (error) { console.log('Error while trying to unsubscribe', error); }); Unsubscribe the User
instead Move long-running JavaScript off the main thread to Web Workers Use micro-tasks to make DOM changes over several frames Use Chrome DevTools’ Timeline and JavaScript Profiler to assess the impact of JavaScript
instead Move long-running JavaScript off the main thread to Web Workers Use micro-tasks to make DOM changes over several frames Use Chrome DevTools’ Timeline and JavaScript Profiler to assess the impact of JavaScript
thread is now free to continue working on other things... dataSortWorker.addEventListener('message', function (evt) { var sortedData = evt.data; // Update data on screen... });
instead Move long-running JavaScript off the main thread to Web Workers Use micro-tasks to make DOM changes over several frames Use Chrome DevTools’ Timeline and JavaScript Profiler to assess the impact of JavaScript
taskFinishTime; do { var nextTask = taskList.pop(); // Assume the next task is pushed onto a stack. processTask(nextTask); // Process nextTask. // Go again if there’s enough time to do the next task. taskFinishTime = window.performance.now(); } while (taskFinishTime - taskStartTime < 3); if (taskList.length > 0) requestAnimationFrame(processTaskList); }
instead Move long-running JavaScript off the main thread to Web Workers Use micro-tasks to make DOM changes over several frames Use Chrome DevTools’ Timeline and JavaScript Profiler to assess the impact of JavaScript
days 88% improvement in load time for AMP content versus traditional mobile web 1000+ articles The Washington Post publishes in AMP HTML daily Live: https://www.washingtonpost.com