npm run bench.
All benchmarks measure computation time from JS and Python, respectively. To learn more, check out benchmark methodology.
Benchmark Summary
- Average speedup: 1.22x vs NumPy
- Best case: 38.46x
- Worst case: 0.11x
- Total benchmarks: 2390
- Machine: Apple M4 Max (16 cores, 128 GB, arm64)
- numpy-ts version: 1.3.0
Performance by Category
| Category | Avg Speedup | Count | Faster | Slower |
|---|---|---|---|---|
| creation | 1.31x | 213 | 150 | 63 |
| arithmetic | 1.28x | 295 | 160 | 135 |
| math | 0.61x | 125 | 29 | 96 |
| trig | 0.55x | 216 | 46 | 170 |
| gradient | 3.54x | 22 | 22 | 0 |
| linalg | 1.91x | 269 | 197 | 72 |
| reductions | 1.04x | 413 | 237 | 176 |
| manipulation | 1.87x | 231 | 192 | 39 |
| io | 2.19x | 66 | 53 | 13 |
| indexing | 0.71x | 115 | 36 | 79 |
| bitwise | 0.83x | 10 | 3 | 7 |
| sorting | 0.87x | 75 | 25 | 50 |
| logic | 2.33x | 142 | 107 | 35 |
| statistics | 1.55x | 26 | 15 | 11 |
| sets | 2.25x | 33 | 20 | 13 |
| random | 0.89x | 46 | 16 | 30 |
| polynomials | 3.19x | 27 | 27 | 0 |
| fft | 0.84x | 66 | 26 | 40 |
Performance by DType
| DType | Avg Speedup | Median Speedup | Count |
|---|---|---|---|
| float64 | 1.03x | 1.00x | 288 |
| float32 | 1.13x | 1.07x | 238 |
| float16 | 1.54x | 1.47x | 211 |
| int64 | 1.08x | 1.10x | 196 |
| uint64 | 1.01x | 1.04x | 188 |
| int32 | 1.25x | 1.24x | 204 |
| uint32 | 1.30x | 1.28x | 189 |
| int16 | 1.32x | 1.48x | 185 |
| uint16 | 1.31x | 1.45x | 184 |
| int8 | 1.55x | 1.58x | 185 |
| uint8 | 1.55x | 1.61x | 186 |
| complex128 | 0.85x | 0.86x | 68 |
| complex64 | 0.76x | 0.68x | 68 |