My benchmarking shows that the duplicating implementation is much faster than looping. Thanks @cheddar