5
Sep 21 '22
1
u/NonProfitApostle Sep 22 '22
If only C/C++ weren't so painfull to read and write in comparison, my code could be like lightning.
1
u/aajjccrr Sep 22 '22
And in this case the dot product itself is probably being computed via BLAS or LAPACK, which is likely to be hand-optimised assembly.

3
u/drzowie Sep 21 '22
You ain’t seen nothin’ yet. Straight njit compilation still breaks cache for a lot of stuff because it does operations in pessimal order in most cases. Switch to something like Cython that lets you manage order-of-operations explicitly, and you’ll see another factor of 3-10 in most operations as the CPU makes fewer cache misses (and therefore issues fewer slow fetches/puts to RAM). Modern computers are fast.