Skip to content

kurtextrem/awesome-performance-patches

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 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 using a reliable benchmarking tool such as bench-node or Tachometer.
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
  • typescript (PR #2) - ensure objects have a consistent set of properties with a consistent initialization order ("monomorphism"), related to hidden classes
  • 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)
  • nodejs/undici - converts object argument to plain arguments (see also DevTools & Preact hotpath, Fastify, Hermes)
  • unjs/unhead - reduces Promise use, optimizes arrays to Set, replaces string.split with string.indexOf() + string.substring() and more
  • vuejs/core - avoid Promise use

Blog Posts with Code 📖

Algorithmic 📖

Perf Audits 📝

CSS & Rendering

Patches focused on CSS performance improvements.

Blog Posts with Code 📖

Animations 💫

HTML & Core Web Vitals 📈

Patches focused on HTML & Core 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
  • nkzw-tech/athena-crisis - moves rendering of 1000 images from <img> to canvas to drastically reduce memory footprint

Guides:

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

Guides:

VSCode

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