🏎 Web performance tips

👋 FYI, this note is over 6 months old. Some of the content may be out of date.
On this page

Reduce Cumulative Layout Shift Jump to heading

Reduce Cumulative Layout Shift by always showing the scrollbar

html {
overflow-y: scroll;
}

https://twitter.com/TimVereecke/status/1239454788116533248

Performance API Jump to heading

performance.mark('start')
// some code we want to measure
performance.mark('end')

Benchmarking code using node Jump to heading

# assume there's an `add` function that is executed in benchmark.js

node --trace-opt benchmark.js | grep add
node --trace-opt --trace-deopt benchmark.js | grep add

# add %NeverOptimizeFuntion(add)
node --allow-natives-syntax benchmark.js

← Back home