pnpm run bench.
All benchmarks measure computation time from JS and Python, respectively. To learn more, check out benchmark methodology.
Benchmark Summary
- Average speedup: 1.25x vs NumPy
- Best case: 2363.88x
- Worst case: 0.10x
- Total benchmarks: 7159
- Machine: Apple M4 Max (16 cores, 128 GB, arm64)
- numpy-ts version: 1.5.0
Performance by Category
| Category | Avg Speedup | Count | Faster | Slower |
|---|---|---|---|---|
| creation | 1.73x | 639 | 465 | 174 |
| arithmetic | 1.18x | 885 | 434 | 451 |
| math | 1.46x | 375 | 280 | 95 |
| trig | 1.08x | 648 | 365 | 283 |
| gradient | 4.27x | 66 | 66 | 0 |
| linalg | 1.48x | 807 | 514 | 293 |
| reductions | 1.07x | 1239 | 658 | 581 |
| manipulation | 1.06x | 693 | 299 | 394 |
| io | 2.55x | 187 | 162 | 25 |
| indexing | 0.66x | 345 | 118 | 227 |
| bitwise | 0.66x | 30 | 7 | 23 |
| sorting | 0.80x | 225 | 56 | 169 |
| logic | 1.68x | 426 | 241 | 185 |
| statistics | 1.60x | 78 | 52 | 26 |
| sets | 3.24x | 99 | 78 | 21 |
| random | 0.89x | 138 | 43 | 95 |
| polynomials | 2.05x | 81 | 63 | 18 |
| fft | 0.89x | 198 | 85 | 113 |
Performance by DType
| DType | Avg Speedup | Median Speedup | Count |
|---|---|---|---|
| float64 | 1.17x | 1.01x | 863 |
| float32 | 1.14x | 1.05x | 713 |
| float16 | 1.44x | 1.44x | 632 |
| int64 | 1.14x | 1.05x | 587 |
| uint64 | 1.14x | 1.06x | 563 |
| int32 | 1.30x | 1.21x | 611 |
| uint32 | 1.34x | 1.26x | 566 |
| int16 | 1.33x | 1.20x | 554 |
| uint16 | 1.33x | 1.20x | 551 |
| int8 | 1.42x | 1.28x | 554 |
| uint8 | 1.41x | 1.30x | 557 |
| complex128 | 0.93x | 0.89x | 204 |
| complex64 | 0.86x | 0.79x | 204 |