/
๐ŸŽ

Performance tips

On this page
  • Reduce Cumulative Layout Shift
  • Performance API
  • Benchmarking code using node

Reduce Cumulative Layout Shift

Reduce Cumulative Layout Shift by always showing the scrollbar

css
html {
overflow-y: scroll;
}

twitter.com/TimVere...16533248

Performance API

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

Benchmarking code using node

sh
# 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
Edit this page
Want to make your own site like this?
Try gatsby-theme-code-notes by Zander Martineau.
Notes on code. My second brain, by Zander Martineau.