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.22x vs NumPy
- Best case: 3236.34x
- Worst case: 0.01x
- Total benchmarks: 11245
- Machine: Apple M4 Max (16 cores, 128 GB, arm64)
- numpy-ts version: 1.8.0
Performance by Category
| Category | Avg Speedup | Count | Faster | Slower |
|---|---|---|---|---|
| creation | 1.47x | 855 | 542 | 313 |
| arithmetic | 1.25x | 1461 | 755 | 706 |
| math | 1.16x | 960 | 517 | 443 |
| trig | 1.05x | 654 | 356 | 298 |
| gradient | 5.01x | 66 | 66 | 0 |
| linalg | 1.41x | 1119 | 677 | 442 |
| reductions | 1.22x | 1716 | 1026 | 690 |
| manipulation | 1.27x | 1488 | 856 | 632 |
| io | 2.65x | 187 | 162 | 25 |
| indexing | 0.88x | 561 | 286 | 275 |
| bitwise | 0.77x | 198 | 43 | 155 |
| sorting | 0.83x | 264 | 81 | 183 |
| logic | 1.03x | 825 | 366 | 459 |
| statistics | 1.22x | 90 | 57 | 33 |
| sets | 1.57x | 363 | 218 | 145 |
| random | 0.88x | 138 | 46 | 92 |
| polynomials | 2.33x | 84 | 66 | 18 |
| fft | 0.82x | 216 | 93 | 123 |
Performance by DType
| DType | Avg Speedup | Median Speedup | Count |
|---|---|---|---|
| float64 | 1.28x | 1.09x | 1142 |
| float32 | 1.34x | 1.16x | 1013 |
| float16 | 1.46x | 1.41x | 953 |
| int64 | 1.05x | 1.04x | 938 |
| uint64 | 1.04x | 1.04x | 917 |
| int32 | 1.27x | 1.21x | 929 |
| uint32 | 1.26x | 1.20x | 917 |
| int16 | 1.28x | 1.17x | 896 |
| uint16 | 1.29x | 1.16x | 893 |
| int8 | 1.32x | 1.16x | 896 |
| uint8 | 1.31x | 1.12x | 899 |
| complex128 | 0.85x | 0.86x | 426 |
| complex64 | 0.84x | 0.75x | 426 |