GitHub radar

A drop-in replacement for cn(), 3.8x faster

A drop-in replacement for the widely-used cn utility in Tailwind CSS applications. Up to 7x faster than tailwind-merge. Same API, no code changes required.

01aidenybai/cnfast 579TypeScript

cnfast is a Typescript library which offers a drop-in replacement for the widely used cn utility function in Tailwind CSS projects. With the help of call-site identity caching and V8 argument caching, cnfast can offer an average of 3.8x and peak of 7x speed improvement over tailwind-merge with same byte size. Created by Aiden Bai, author of million.js, a popular Virtual DOM Optimizer.

Why a vibe-coder should care

If you’re using cn() in your React app and experiencing slowness while rendering many components/complex tables, use cnfast! It’s just a single line of code to swap out cn().

Open on GitHub