image src & read more at:
https://developers.google.com/web/fundamentals/performance/rail
image src & read more at:
https://www.w3.org/TR/navigation-timing
const t0 = performance.now();
doSomething();
const t1 = performance.now();
console.log("Call to doSomething took " + (t1 - t0) + " milliseconds.");
image src & read more at:
https://www.w3.org/TR/navigation-timing-2/
const [perfData] = performance.getEntriesByType('navigation');
// similar to window.performance.timing;
const pageLoadTime = perfData.loadEventEnd - perfData.startTime;
const dnsLookupTime = perfData.domainLookupEnd - perfData.domainLookupStart;
const renderTime = perfData.domComplete - perfData.domLoading;
const timeTillFirstBye = perfData.responseStart - perfData.requestStart;
read more at:
https://www.w3.org/TR/navigation-timing-2/
t = 3521ms
// finding data for resources with versioning
const [ringTimingData] = performance.getEntries()
.filter(({name}) => name.includes('voluum_frontend_ring'));
// choosing data by name
const [resourceData] = performance
.getEntriesByName('https://domain.com/smiesznypiesek.jpg');
// retrieving script transfer size
const scriptsResources = performance.getEntriesByType('resource')
.filter(entry => entry.initiatorType === 'script');
const scriptsTransferSize = scriptsResources
.reduce((sum, {transferSize})=> sum + transferSize, 0);
const observer = new PerformanceObserver(obsrvr => {
const entries = obsrvr.getEntries();
// queue perf data to send
});
observer.observe({entryTypes: ["resource"]});
// ...
observer.disconnect();
read more at:
https://w3c.github.io/longtasks
const observer = new PerformanceObserver(function(list) {
const perfEntries = list.getEntries();
// queue reporting for long tasks existance
});
observer.observe({entryTypes: ["longtask"]});
// long task refers to occurrences of event loop tasks
// or pauses caused by UI thread work
// whose duration exceeds 50ms
// first-paint, first-contentful-paint
const timingEntries = performance.getEntriesByType('paint');
image src & read more at:
https://developers.google.com/web/fundamentals/performance/rail
read more at:
https://http2.github.io/faq/
read more at:
https://v8project.blogspot.com/2018/01/hash-code.html
image soruce:
https://pexels.com