性能監控 / 性能指標 / 性能優化html
FCP前端
白屏時間:從瀏覽器輸入地址並回車後到頁面開始有內容的時間;web
FMPapi
首屏時間:從瀏覽器輸入地址並回車後到首屏內容渲染完畢的時間;瀏覽器
不須要交互 ? TTI性能優化
❓ Navigation Timing Level 2, W3C Working Draft 21 January 2020ide
https://www.w3.org/TR/navigation-timing-2/佈局
✅ Navigation Timing, W3C Recommendation 17 December 2012性能
https://www.w3.org/TR/navigation-timing/flex
https://developer.mozilla.org/en-US/docs/Web/API/Navigation_timing_API
https://developer.mozilla.org/en-US/docs/Web/API/Navigation_timing_API/Using_Navigation_Timing
window.addEventListener("load", function() { let now = new Date().getTime(); let loadingTime = now - performance.timing.navigationStart; document.querySelector(".output").innerText = loadingTime + " ms"; }, false);
window.addEventListener("load", function() { let now = new Date().getTime(); let loadingTime = now - performance.timing.navigationStart; output = "Load time: " + loadingTime + " ms<br/>"; output += "Navigation type: "; switch(performance.navigation.type) { case PerformanceNavigation.TYPE_NAVIGATE: output += "Navigation"; break; case PerformanceNavigation.TYPE_RELOAD: output += "Reload"; break; case PerformanceNavigation.TYPE_BACK_FORWARD: output += "History"; break; default: output += "Unknown"; break; } output += "<br/>Redirects: " + performance.navigation.redirectCount; document.querySelector(".output").innerHTML = output; }, false);
https://developers.google.com/web/fundamentals/performance/navigation-and-resource-timing
Time To First Byte
第一個字節到達的時間
Time To First Paint
第一次繪製的時間
https://developers.google.com/web/fundamentals/glossary
Total Blocking Time
總阻塞時間
DOMContentLoaded Event
DOM 內容加載完成 事件
First Paint
首次繪製
First Contentful Paint
首次有內容的繪製
https://web.dev/first-contentful-paint
First Meaningful Paint
首次有意義的繪製
https://web.dev/first-meaningful-paint/
Largest Contentful Paint
最大內容的繪製
Time to Interactive
可交互時間
First Input Delay
首次輸入延遲
Cumulative Layout Shift
累積佈局移位
Speed Index
速度指數
Chrome DevTools & performance / 性能指標
https://developers.google.com/web/fundamentals/performance/user-centric-performance-metrics
https://web.dev/user-centric-performance-metrics/
https://web.dev/custom-metrics/
http://www.javashuo.com/article/p-sqxeadmt-vd.html
©xgqfrms 2012-2020
www.cnblogs.com 發佈文章使用:只容許註冊用戶才能夠訪問!