🏎 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;


Performance API Jump to heading

// some code we want to measure

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