How 4 bytes of padding make array clearing 49% faster
An alignment quirk on Intel and AMD CPUs: keeping a Go array 8-byte aligned (vs offset 4) makes clearing it up to 49% faster, thanks to how REP STOSQ works.
评论
?
参与讨论
An alignment quirk on Intel and AMD CPUs: keeping a Go array 8-byte aligned (vs offset 4) makes clearing it up to 49% faster, thanks to how REP STOSQ works.