Tim Wang @timwangdev
The first page loading performance on the ACC/ BIM360 Cost website is slow.
But how slow?
First loading:
Lab data, also known as synthetic data, is collected from a controlled environment (eg. Jenkins), rather than actual users.
Testing Environment:
Lighthouse is an open-source, automated tool for auditing the quality of web pages. Lighthouse can be run in Chrome DevTools, from the command line, or as a Node module.
Device emulated: Desktop
Network throttling: 40 ms TCP RTT, 10,240 Kbps throughput (Simulated)
CPU throttling: 1x slowdown (Simulated)
In Cost, FCP stands for the user seeing the project skeleton for the first time. It indicates the app is starting to load page content. And LCP stands for main table structure (header, actions menu, etc) was shown to the user.
First Contentful Paint (FCP)
Largest Contentful Paint (LCP)
Cumulative Layout Shift (CLS)
Understand how browser loads first page from initial index.html request.
Eliminate render-blocking resources
Keep request counts low and transfer sizes small
Render partial content as soon as it is ready
API call chain requests take over half of the initial loading time, and requests are heavily queued with browser limitation.
Optimizations for API call chains:
Using the Performance API - Web APIs | MDN - https://developer.mozilla.org/en-US/docs/Web/API/Performance_API/Using_the_Performance_API
const markerNameA = "example-marker-a"
const markerNameB = "example-marker-b"
// Run some nested timeouts, and create a PerformanceMark for each.
performance.mark(markerNameA);
setTimeout(function() {
performance.mark(markerNameB);
setTimeout(function() {
// Create a variety of measurements.
performance.measure("measure a to b", markerNameA, markerNameB);
performance.measure("measure a to now", markerNameA);
performance.measure("measure from navigation start to b", undefined, markerNameB);
performance.measure("measure from navigation start to now");
// Pull out all of the measurements.
console.log(performance.getEntriesByType("measure"));
// Finally, clean up the entries.
performance.clearMarks();
performance.clearMeasures();
}, 1000);
}, 1000);