uniku
Guides

Performance and bundle size

Every uniku generator beats its dedicated npm alternative in the current CI benchmark. See the measurements and bundle cost of each import.

Generation speed is a primary design constraint in uniku. In the current CI snapshot, every one of its ten strategies beats the dedicated npm implementation it targets. The smallest measured lead is 1.2× for UUID v4 and ObjectID; ULID reaches 116×.

The claim is deliberately scoped to generation speed against the established package for each format. Application performance still depends on where and how IDs are created.

Generation speed

Each row compares uniku's generator against the npm package it targets: uuid for UUID v4/v7, ulid, @paralleldrive/cuid2, @owpz/ksuid, bson for ObjectID, nexid for XID, tsid-ts, nanoid, and typeid-js.

This snapshot comes from a four-repetition CI run on July 14, 2026. Treat the ratios as directional because shared-runner noise and dependency updates can move them. The rolling baseline tracks results across CI runs for regression detection.

Generatoruniku vs npm
ULID116× faster
UUID v76.3× faster
CUID26.2× faster
TypeID3.3× faster
TSID2.3× faster
Nanoid2× faster
KSUID1.6× faster
XID1.4× faster
Nanoid (10 chars)1.4× faster
UUID v41.2× faster
ObjectID1.2× faster

The compatibility benchmark runs each implementation in a fresh process. CI balances both launch orders across four repetitions and reports the per-row median, so warmed runtime state and one noisy run do not decide the comparison.

Bundle size

Every entry point is independently importable and tree-shakeable: importing uniku/ulid does not pull in the ULID, TypeID, or KSUID code. Minified and gzipped sizes per entry point:

ImportMinified + gzipped
uniku/ulid~1.9 KB
uniku/typeid~2.7 KB
uniku/uuid/v7~1.6 KB
uniku/tsid~1.6 KB
uniku/ksuid~1.3 KB
uniku/objectid~1.4 KB
uniku/xid~1.9 KB
uniku/nanoid~1.2 KB
uniku/uuid/v4~1.2 KB
uniku/cuid/v2~1015 B
uniku/cuid2~1.0 KB
uniku/errors~184 B
uniku/generators~101 B

The CUID v2 entry point imports SHA3-512 from @noble/hashes, uniku's one runtime dependency; the size above excludes that external dependency's own weight.

Reproduce these numbers

Run the benchmark and bundle-size tooling from the repository root:

pnpm bench:summary
pnpm bundle:summary

bench:summary runs uniku's generators against the equivalent npm package and prints a comparison table. bundle:summary builds each entry point and reports its minified, gzipped size.

On this page