Optimize stride copy function