3 ms·
Update: I ran a quick benchmark (large matrix multiplication) between GNU APL, J, and NumPy (standard pre-compiled linux amd64 packages, all running single-core
by etatoby 8y ago
Update: I ran a quick benchmark (large matrix multiplication) between GNU APL, J, and NumPy (standard pre-compiled linux amd64 packages, all running single-core.) Here are the results.
GNU APL (1.7)
⍴+.×⌿?2 3000 3000⍴1e10
- size 3000: 65s, 9GiB RSS
(crash on bigger sizes)
J (8.07)
$(+/ .*)/?2 3000 3000$1e10
- size 3000: 2s, 0.2GiB RSS
- size 10000: 60s, 3.7GiB RSS
(crash on bigger sizes)
NumPy (1.13.3, blas/lapack 3.7.1)
import numpy
a=numpy.random.randint(0, 1e10, (2,3000,3000))
print((a[0,] @ a[1,]).shape)
- size 3000: 25s, 0.2GiB RSS
- size 10000: (>15m, I killed it) 2.3GiB RSS
Conclusions:
J's implementation is surprisingly performant! Easily beating NumPy on speed alone by a factor of 10 or more! (And I thought blas/lapack were already heavily optimized libraries!) J's memory usage is comparable to that of NumPy. GNU APL had the worst memory and cpu profile of them all.
- etatoby 7y agoJust thought I'd add the same benchmark on the latest Dyalog APL. Dyalog APL/S-64 (17) ⍴+.×⌿?2 3000 3000⍴1e10 - size 3000: 6.6s, 0.5GiB RSS - size 10000: 101s, 5.4GiB RSS Conclusions: J's implementation is still the fastest at this particular task (matrix multiplication of huge matrices on a single CPU thread--granted, not the most significant of benchmarks.) Dyalog APL comes close behind. GNU APL and NumPy lag much more behind that.
- Volt 7y agoI'm trying this with Dyalog 16 (Mac OS X) and I'm getting WS FULL. Do you know why that might be? BTW, what kind of machine are you testing on?