Skip to content

kurtextrem/awesome-performance-patches

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Awesome Performance Patches Awesome

🚀⚡ Awesome lists about performance related patches/PRs.

The purpose of this awesome list is to allow others to learn from performance improvements of the past 📝, so that you can submit your performance improvement sooner or later here as well 🤝.

The list also includes blog posts without PRs, if they contain enough code to make them useful for this purpose.
⭐ marks blog posts or articles covering a lot of areas with in-depth explanations.

For Web Performance, there are a few more lists of curated links of talks, newsletters, blogs and more:
➡️ fabkrum/web-performance-resources ➡️ imteekay/web-performance-research ➡️ nucliweb/webperf-snippets

Hint: What improves performance might change over time; always re-validate assumptions by benchmarking.
Follow me on Twitter for updates.

Contents

JavaScript

Patches focused on JavaScript performance improvements. Guides:

Caching / Doing less work

Data Structures

Unsorted

  • node-semver - bit flags instead of string manipulation
  • node-semver - Object#freeze for lower memory consumption at around equal perf
  • typescript - var is faster than let/const in the specific use case of TypeScript
  • three.js - prevent memory leak from sliced strings
  • graphql-js - for..of downtranspilation & destructuring optimization
  • preact/signals - convert ES6 classes to ES5 classes for higher performance
  • fabianhiller/valibot - lazy evaluation, "is object" check via var?.constructor !== Object, array tuples to flat array
  • nodejs/node - replace N boolean props with one bitmap
  • fabianhiller/valibot - avoid (negative) look-aheads for faster regexp execution
  • ai/nanoid - re-ordered alphabet for smaller brotli compression
  • astro - AsyncIterable instead of a ReadableStream
  • TanStack/query - avoid too frequent setTimeout & cancelTimeout
  • react - maintain the same object key across the code to avoid causing de-opts
  • microsoft/vscode-js-debug - faster stream splitting
  • fastify - indexOf -> slice to reduce worst-case runtime duration
  • vitejs/vite - caches repeated import() calls (see also, tweet)

Blog Posts with Code 📖

Algorithmic 📖

Perf Audits 📝

CSS & Rendering

Patches focused on CSS performance improvements.

  • nuka-carousel - removes huge layers by fixing negative z-index
  • mui/mui-x - collection of MUI improvements:
    • recalculate style - avoiding updating CSS variables on parents for shorter "recalculate style" tasks
    • layerize - make "layerize" tasks shorter by avoiding creating many layers
    • scroll direction - emphasize scroll direction for optimistic updates

Blog Posts with Code 📖

Animations 💫

HTML & Web Vitals 📈

Patches focused on HTML & Web Vitals performance improvements.

  • sentry - replaces React's autofocus implementation with manual focus in the next task for improved INP
  • radix-ui/primitives - sets CSS inline style on <body> after giving the browser a chance to paint for improved INP

Blog posts:

TypeScript

Patches focused on TypeScript runtime performance improvements (e.g. running tsc). The TS team also has a dedicated wiki page. Attest can help you benchmark.

  • sentry - avoid large unions in favor of interfaces
  • tRPC - avoid disabling the lazy evaluation of TypeScript types
  • TanStack/router

Contribute

Contributions welcome! Read the contribution guidelines first.

About

🚀⚡ Awesome list about performance related patches/PRs.

Topics

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published