specialize arrayUpdate() as that is the bottleneck in speed and memory