@dzaima Now that's interesting. Do you want to email support about it, or should I ask Marshall (our main performance guy) directly? You're also using 64 bit IEEE floats, right?
more comparison because testing is fun https://tio.run/##xZjNalNBFMf3fYq7bmCcc2bOfEDVZ7lpUQSpoiDoSlxIsal0EYkLwY0rEdwE3GRl3uS@SDz3a2Za781ypoQyMyG5P/7/8zU5ry/f1K8Ph7r5ePsYZffX3GzlyfL@wUmzXjXr9/@9fs0fTr515Lx/3fKTPrx89eJpVfHi4m1VdYvzdvOuGnb7zYP9n2rc8Se@TX3Vbv5wN/P03VG2Hy1b8/nLxfNKAC8rkFJguwgb09IxGghWzmSHwwX2mvB/KeSI1m00r55dPikkGzY33@uRzWmhePGo2yAKJztTq0oJ440vDkcRDgRFOK9AZoerGS646lwXcEE5TREOfRm4ejLklBfeFQ25lm05siknXGDTUngdM5UI8peRXreBx3b1ZHBVCnCDqyiU0jp/PpyOnoIkoQMa6yYpoBkF@VO1Po0VDoWNFU4LhGApkS@BpgIaxb7QqqbHvmCFdYAF0EKSMo1J0bpyO7YshAJoywSN0ljrDd30aDa/aqcxQ5GrWUADEzsWsKEyf93F/SaWXZV2eu5eLuYBugLB…
arrays are represented in memory in row-major order. if you do b⊥ on that matrix, the interpreter would have to multiply the first row by b and add it to the second row. it's more efficient to perform operations on stretches of consecutive memory instead of jumping over gaps
@ngn i understand the concept you're saying, but your phrasing isn't clear to me. If I do b⊥ on which matrix? The interpreter would have to, and that's good, or would have to and that's bad? Which way is row-major order?
@TessellatingHeckler if the matrix is oriented like this, it's good, otherwise bad :)
if the matrix was the transposition of the above, its elements would be represented in memory as 2 7 2 8 2 9 and the interpreter wouldn't be able to take advantage of sse/avx instructions
@ngn thank you :) there's just a lot of background knowledge I don't have; if I don't know row-major then I can see consecutive memory access is better, but still not know which axis is consecutive
I have read that J language does something different with prioritising rows / columns compared to APL
but I don't know what. Is there any record of whether Iverson was happy with how J turned out or not?
@TessellatingHeckler i don't know enough j to be confident about this, but they probably meant that things like reduction in j work by default along the leading axis (example), as opposed to apl in which reduction is last-axis by default
@ngn I'm not familiar with leading-axis / last-axis terms either; I've mostly only played with single row vectors and a tiny bit with 2D matrixes. I do see that's adding down, instead of accross, but I imagine this matters more with more dimensions
find enough base 2 digits to handle the max value in the array, then pass that into encode
tbh I'm still boggling that base conversion is a fundamental part of APL
in PowerShell / C# / .Net world, they only bothered to implement base conversions between binary (String), decimal, hex (String), and only a single one
the example "24 60 60 ⊥ 2 46 40" is .. so different