3 ms·
> on x86, probably "rep movsb" or whatever) Sadly I don't have a link, but as far as I remember rep movsb was always hilariously slow. So memcpy implementation
by josefx 5y ago
> on x86, probably "rep movsb" or whatever)
Sadly I don't have a link, but as far as I remember rep movsb was always hilariously slow. So memcpy implementations tried to optimize copies using half a page of vector instructions with size and alignment tests, which of course killed the CPUs instruction cache.
- benttoothpaste 5y agoAlways hilariously slow? That must have been before Ivy Bridge.
- sedatk 5y agoYes, a compiler would at least add a combo of rep movsq + rep movsd + rep movsw to the mix before finishing the final remainder with rep movsb. Vector instructions might help tremendously too.
- bjourne 5y agoHilariously slow before Intel engineers decided to optimize the shit out of the construction. :)