Re:A 100LOC C impl of memset, that is faster than glibc's
by sedatk on Saturday November 13, 2021 @02:11AM
(#29208030)
Yes, 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.
Re:A 100LOC C impl of memset, that is faster than glibc's
by benttoothpaste on Friday November 12, 2021 @02:26PM
(#29203509)
Always hilariously slow? That must have been before Ivy Bridge.
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.