I tried both, keeping `pos0` and `pos1` as both global and local variables and the speed was the same.