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.36x vs NumPy
- Best case: 3535.38x
- Worst case: 0.05x
- Total benchmarks: 10528
- Machine: Apple M4 Max (16 cores, 128 GB, arm64)
- numpy-ts version: 1.7.0
Performance by Category
| Category | Avg Speedup | Count | Faster | Slower |
|---|---|---|---|---|
| creation | 2.04x | 759 | 571 | 188 |
| arithmetic | 1.41x | 1263 | 702 | 561 |
| math | 1.36x | 876 | 514 | 362 |
| trig | 1.11x | 648 | 365 | 283 |
| gradient | 4.63x | 66 | 66 | 0 |
| linalg | 1.89x | 876 | 627 | 249 |
| reductions | 1.25x | 1563 | 961 | 602 |
| manipulation | 1.41x | 1464 | 934 | 530 |
| io | 2.69x | 187 | 161 | 26 |
| indexing | 0.84x | 678 | 323 | 355 |
| bitwise | 0.78x | 198 | 45 | 153 |
| sorting | 0.84x | 264 | 84 | 180 |
| logic | 1.37x | 822 | 393 | 429 |
| statistics | 1.91x | 84 | 64 | 20 |
| sets | 1.16x | 363 | 200 | 163 |
| random | 0.90x | 138 | 47 | 91 |
| polynomials | 2.35x | 81 | 63 | 18 |
| fft | 1.05x | 198 | 97 | 101 |
Performance by DType
| DType | Avg Speedup | Median Speedup | Count |
|---|---|---|---|
| float64 | 1.37x | 1.17x | 1118 |
| float32 | 1.43x | 1.30x | 1031 |
| float16 | 1.59x | 1.48x | 938 |
| int64 | 1.23x | 1.14x | 893 |
| uint64 | 1.20x | 1.13x | 869 |
| int32 | 1.41x | 1.33x | 887 |
| uint32 | 1.39x | 1.30x | 869 |
| int16 | 1.40x | 1.23x | 854 |
| uint16 | 1.39x | 1.22x | 851 |
| int8 | 1.43x | 1.29x | 854 |
| uint8 | 1.41x | 1.26x | 857 |
| complex128 | 0.99x | 0.88x | 249 |
| complex64 | 0.93x | 0.81x | 249 |
| bool | 0.51x | 0.45x | 9 |