Forum Discussion
Medohh2120
May 28, 2026Copper Contributor
BYROW/BYCOL/MAP Variants for Nested Arrays + BENCHMARK
Hey everyone!
I made some simple BYROW, BYCOL, and MAP variants that can return nested arrays, and I also made a BENCHMARK function for performance testing.
Here's some code for testing:
BYROW⊟ = LAMBDA(array, function, [orient],
LET(
me, LAMBDA(me, seg,
LET(
n, ROWS(seg),
IF(
n = 1,
function(seg),
IF(
orient,
HSTACK(
me(me, TAKE(seg, INT(n / 2))),
me(me, DROP(seg, INT(n / 2)))
),
VSTACK(
me(me, TAKE(seg, INT(n / 2))),
me(me, DROP(seg, INT(n / 2)))
)
)
)
)
),
IFNA(me(me, array), "")
)
);I didn’t put a huge amount of effort into polishing this but In my tests on my device, these performed a lot better than using REDUCE + VSTACK for the same kind of thing, so maybe it’ll be useful to someone.
Really curious to see how people use it, and if something looks like it should be optimized or changed, say so.
I'll update them regularly, fix bugs whenever I can.
You can find the rest of them on my Gist pages: https://gist.github.com/Medohh2120/f565516bc636700adf5ba27fd8f0d19e, https://gist.github.com/Medohh2120/d9d04f56d93694aed9d0c49d516f0fbf.
No RepliesBe the first to reply