GitHub radar

cnfast: 3.8× faster drop-in for cn()

A new library replaces the popular `cn` utility used in Tailwind CSS projects — same API, no code changes needed, up to 7× faster on heavy component trees.

01aidenybai/cnfast 579TypeScript

cnfast is a TypeScript library that replaces the `cn` utility function used in virtually every Tailwind CSS codebase. It achieves 3.8× average and up to 7× peak speedup over tailwind-merge by applying call-site identity caching and V8 argument caching — the output stays byte-identical, only the performance changes. The author, Aiden Bai, previously created million.js, a virtual DOM optimizer with a large following.

Why a vibe-coder should care

If your React app feels sluggish on pages with many components or data-heavy tables, cn() might be the hidden culprit. cnfast fixes it with a single import change — no refactoring, no learning curve.

Open on GitHub