idgenkit

Benchmarks

How long it takes to generate one ID, in each library and database. For what IDs cost once stored (index size, insert speed, compression), see Data engineering and storage. Those effects are usually much larger than generation time: at 70 ns per ID, a million IDs take 70 ms to generate.

Measured on an Apple M-series Mac (arm64, 14 cores), single-threaded unless marked ×8. The databases ran in Docker (PostgreSQL) or natively (MySQL, Redis). Rerun everything with make bench; the full report is in bench/results/.

Libraries

Nanoseconds per ID; lower is better.

  ULID ULID monotonic ULID parse UUIDv4 UUIDv7 UUIDv7 monotonic Relative ID Snowflake Nano ID (21)
C core 81 25 21 91 73 23 75 244 132
Rust 65 33 8 74 70 33 117 244 131
Go 125 45 15 257 122 54 141 244 297
Java 24 239 28 34 139 250 28 255 244 226
Python 3.12 1,346 439 434 1,868 2,003 973 1,577 415 1,198

Source: bench/results/2026-09-25-darwin-arm64.txt, generated by bench/doc_tables.py.

Databases

  ULID ULID monotonic ULID as uuid UUIDv7 UUIDv7 monotonic Relative ID Snowflake Nano ID Built-in reference
PostgreSQL 17 (ns per row) 81 43 71 61 28 84 196 99 gen_random_uuid() 612
MySQL 9.2 (ns per call) 103 65 — 111 65 133 282 203 UUID() 70
Redis 8.4 (requests/s) 528k 462k — 504k 481k 515k 432k 490k PING 551k

Source: bench/results/2026-09-25-darwin-arm64.txt, generated by bench/doc_tables.py.