Sites built with Svelte are faster than those built with React and Vue. Sites built with React are faster than those built with Vue.
Svelte produces larger pages: 3.9 MB vs 3.5 MB for Vue and 3.3 MB for React.
Sites built with Svelte are faster than those built with React and Vue. Sites built with React are faster than those built with Vue.
Svelte produces larger pages: 3.9 MB vs 3.5 MB for Vue and 3.3 MB for React.
(new PerformanceObserver((list) => {
const entries = list.getEntriesByType('layout-shift');
entries.forEach((/*LayoutShift*/entry) => {
console.log(entry);
const /*Array<LayoutShiftAttribution>*/sources = entry.sources || [];
const changes = [];
for (const source of sources) {
const { currentRect: cr, previousRect: pr, node } = source;
const dx = cr.x - pr.x;
const dy = cr.y - pr.y;
const ds = cr.width * cr.height - pr.width * pr.height;
changes.push({dx, dy, ds, node});
}
if (changes.length) {
console.table(changes);
}
});
})).observe({ type: 'layout-shift', buffered: true });
http://www.brendangregg.com/blog/2018-06-30/benchmarking-checklist.html
.on('cycle', function(event) {
console.log(String(event.target));
})
Run Chrome or Node.js with --prof flag
chrome --js-flags='--prof' --no-sandbox 'http://localhost:8080/'
node --prof script.js
Install tick processor https://github.com/dex4er/js-tick-processor
npm install -g tick-processor
tick-processor isolate-0x123456-v8.log >isolate-0x123456-v8.txt