11# Performance Benchmarks
22
3- Comprehensive benchmarks comparing nanofaker against other popular JavaScript/TypeScript faker libraries.
3+ Comprehensive benchmarks comparing ts-mocker against other popular JavaScript/TypeScript faker libraries.
44
55## Latest Results
66
@@ -12,7 +12,7 @@ Comprehensive benchmarks comparing nanofaker against other popular JavaScript/Ty
1212
1313## Summary
1414
15- ✅ ** nanofaker won 9 out of 9 benchmarks**
15+ ✅ ** ts-mocker won 9 out of 9 benchmarks**
1616⚡ ** 6.57x faster than @faker-js/faker on average**
1717
1818## Detailed Results
@@ -21,7 +21,7 @@ Comprehensive benchmarks comparing nanofaker against other popular JavaScript/Ty
2121
2222| Library | ops/s | avg time | margin | vs fastest |
2323| ---------| -------| ----------| --------| ------------|
24- | ** nanofaker ** | 31.35M ops/s | 0.0319ms | ±0.47% | ** (fastest)** ✅ |
24+ | ** ts-mocker ** | 31.35M ops/s | 0.0319ms | ±0.47% | ** (fastest)** ✅ |
2525| @ngneat/falso | 3.76M ops/s | 0.2659ms | ±0.95% | 0.12x |
2626| casual | 2.61M ops/s | 0.3833ms | ±0.96% | 0.08x |
2727| chance | 2.56M ops/s | 0.3900ms | ±1.01% | 0.08x |
@@ -31,7 +31,7 @@ Comprehensive benchmarks comparing nanofaker against other popular JavaScript/Ty
3131
3232| Library | ops/s | avg time | margin | vs fastest |
3333| ---------| -------| ----------| --------| ------------|
34- | ** nanofaker ** | 1.96M ops/s | 0.5098ms | ±1.43% | ** (fastest)** ✅ |
34+ | ** ts-mocker ** | 1.96M ops/s | 0.5098ms | ±1.43% | ** (fastest)** ✅ |
3535| @ngneat/falso | 1.81M ops/s | 0.5512ms | ±1.12% | 0.92x |
3636| casual | 1.09M ops/s | 0.9172ms | ±0.79% | 0.56x |
3737| chance | 849.49K ops/s | 1.1772ms | ±1.43% | 0.43x |
@@ -41,7 +41,7 @@ Comprehensive benchmarks comparing nanofaker against other popular JavaScript/Ty
4141
4242| Library | ops/s | avg time | margin | vs fastest |
4343| ---------| -------| ----------| --------| ------------|
44- | ** nanofaker ** | 9.77M ops/s | 0.1024ms | ±1.13% | ** (fastest)** ✅ |
44+ | ** ts-mocker ** | 9.77M ops/s | 0.1024ms | ±1.13% | ** (fastest)** ✅ |
4545| chance | 2.68M ops/s | 0.3735ms | ±1.21% | 0.27x |
4646| @faker-js/faker | 2.05M ops/s | 0.4869ms | ±0.99% | 0.21x |
4747| casual | 1.23M ops/s | 0.8117ms | ±0.61% | 0.13x |
@@ -51,7 +51,7 @@ Comprehensive benchmarks comparing nanofaker against other popular JavaScript/Ty
5151
5252| Library | ops/s | avg time | margin | vs fastest |
5353| ---------| -------| ----------| --------| ------------|
54- | ** nanofaker ** | 39.63M ops/s | 0.0252ms | ±0.58% | ** (fastest)** ✅ |
54+ | ** ts-mocker ** | 39.63M ops/s | 0.0252ms | ±0.58% | ** (fastest)** ✅ |
5555| @ngneat/falso | 18.13M ops/s | 0.0552ms | ±1.20% | 0.46x |
5656| casual | 1.99M ops/s | 0.5020ms | ±0.89% | 0.05x |
5757| chance | 1.12M ops/s | 0.8969ms | ±1.19% | 0.03x |
@@ -61,7 +61,7 @@ Comprehensive benchmarks comparing nanofaker against other popular JavaScript/Ty
6161
6262| Library | ops/s | avg time | margin | vs fastest |
6363| ---------| -------| ----------| --------| ------------|
64- | ** nanofaker ** | 38.55M ops/s | 0.0259ms | ±0.71% | ** (fastest)** ✅ |
64+ | ** ts-mocker ** | 38.55M ops/s | 0.0259ms | ±0.71% | ** (fastest)** ✅ |
6565| casual | 18.98M ops/s | 0.0527ms | ±1.08% | 0.49x |
6666| @ngneat/falso | 17.93M ops/s | 0.0558ms | ±1.14% | 0.46x |
6767| @faker-js/faker | 15.83M ops/s | 0.0632ms | ±0.80% | 0.41x |
@@ -71,7 +71,7 @@ Comprehensive benchmarks comparing nanofaker against other popular JavaScript/Ty
7171
7272| Library | ops/s | avg time | margin | vs fastest |
7373| ---------| -------| ----------| --------| ------------|
74- | ** nanofaker ** | 37.64M ops/s | 0.0266ms | ±1.15% | ** (fastest)** ✅ |
74+ | ** ts-mocker ** | 37.64M ops/s | 0.0266ms | ±1.15% | ** (fastest)** ✅ |
7575| @ngneat/falso | 17.78M ops/s | 0.0562ms | ±1.09% | 0.47x |
7676| casual | 2.32M ops/s | 0.4317ms | ±0.99% | 0.06x |
7777| chance | 800.45K ops/s | 1.2493ms | ±1.61% | 0.02x |
@@ -81,7 +81,7 @@ Comprehensive benchmarks comparing nanofaker against other popular JavaScript/Ty
8181
8282| Library | ops/s | avg time | margin | vs fastest |
8383| ---------| -------| ----------| --------| ------------|
84- | ** nanofaker ** | 30.65M ops/s | 0.0326ms | ±0.98% | ** (fastest)** ✅ |
84+ | ** ts-mocker ** | 30.65M ops/s | 0.0326ms | ±0.98% | ** (fastest)** ✅ |
8585| casual | 21.34M ops/s | 0.0469ms | ±0.65% | 0.70x |
8686| @faker-js/faker | 17.78M ops/s | 0.0562ms | ±0.49% | 0.58x |
8787| @ngneat/falso | 365.26K ops/s | 2.7378ms | ±0.83% | 0.01x |
@@ -90,7 +90,7 @@ Comprehensive benchmarks comparing nanofaker against other popular JavaScript/Ty
9090
9191| Library | ops/s | avg time | margin | vs fastest |
9292| ---------| -------| ----------| --------| ------------|
93- | ** nanofaker ** | 1.02M ops/s | 0.9849ms | ±0.26% | ** (fastest)** ✅ |
93+ | ** ts-mocker ** | 1.02M ops/s | 0.9849ms | ±0.26% | ** (fastest)** ✅ |
9494| @ngneat/falso | 555.23K ops/s | 1.8011ms | ±0.52% | 0.55x |
9595| @faker-js/faker | 531.61K ops/s | 1.8811ms | ±0.55% | 0.52x |
9696| casual | 464.73K ops/s | 2.1518ms | ±0.53% | 0.46x |
@@ -108,7 +108,7 @@ Generates 10,000 complete user objects with:
108108
109109| Library | Total Time | μs/record | vs fastest |
110110| ---------| ------------| -----------| ------------|
111- | ** nanofaker ** | 7.97ms | 0.7975μs | ** (fastest)** ✅ |
111+ | ** ts-mocker ** | 7.97ms | 0.7975μs | ** (fastest)** ✅ |
112112| casual | 25.44ms | 2.5442μs | 0.31x |
113113| @ngneat/falso | 28.64ms | 2.8644μs | 0.28x |
114114| chance | 33.12ms | 3.3117μs | 0.24x |
@@ -118,28 +118,28 @@ Generates 10,000 complete user objects with:
118118
119119| Library | Version | Published Size | Files |
120120| ---------| ---------| ----------------| -------|
121- | ** nanofaker ** | (core) | ** 174 KB** | ** 38** |
121+ | ** ts-mocker ** | (core) | ** 174 KB** | ** 38** |
122122| ** casual** | v1.6.2 | 408 KB | 75 |
123123| ** @ngneat/falso ** | v7.4.0 | 1.16 MB | 399 |
124124| ** chance** | v1.1.13 | 2.08 MB | 164 |
125125| ** @faker-js/faker ** | v10.0.0 | 4.29 MB | 231 |
126126
127127### Package Size Advantages
128128
129- nanofaker is ** dramatically smaller** than all competitors:
129+ ts-mocker is ** dramatically smaller** than all competitors:
130130
131131- ** 24.7x smaller** than @faker-js/faker (saves 4.12 MB)
132132- ** 12.0x smaller** than chance (saves 1.91 MB)
133133- ** 6.7x smaller** than @ngneat/falso (saves 1.01 MB)
134134- ** 2.4x smaller** than casual (saves 234 KB)
135135
136- Even compared to the smallest competitor (casual), nanofaker is ** 2.4x smaller** while offering 26 full locales vs limited support.
136+ Even compared to the smallest competitor (casual), ts-mocker is ** 2.4x smaller** while offering 26 full locales vs limited support.
137137
138138📦 See [ PACKAGE-SIZES.md] ( ./PACKAGE-SIZES.md ) for detailed size comparison and analysis.
139139
140140## Key Takeaways
141141
142- ### Where nanofaker Excels
142+ ### Where ts-mocker Excels
143143
1441441 . ** Full name generation** - 31.35M ops/s (8.3x faster than nearest competitor)
1451452 . ** Phone number generation** - 9.77M ops/s (3.6x faster than nearest competitor)
@@ -151,7 +151,7 @@ Even compared to the smallest competitor (casual), nanofaker is **2.4x smaller**
151151
152152### Performance vs @faker-js/faker
153153
154- nanofaker is significantly faster across all categories:
154+ ts-mocker is significantly faster across all categories:
155155
156156- ** Full Name** : 58.3x faster
157157- ** Phone Number** : 4.8x faster
@@ -183,7 +183,7 @@ bun run bench
183183- ** Iterations** : Automatic (based on time budget)
184184- ** Benchmarking library** : tinybench v2.9.0
185185
186- ## Why nanofaker is Fast
186+ ## Why ts-mocker is Fast
187187
1881881 . ** Direct array access** - O(1) constant-time lookups
1891892 . ** Minimal overhead** - Lightweight abstraction layer
0 commit comments