From Dev.to
A Fifth Object Shape Made the Same Loop Twice as Slow
Same loop, same array length, same field. One line changes between these two runs: how many kinds of object are in the array. 4 shapes: 1.51 ns per read 5 shapes: 3.31 ns per read The loop is one pro...
