News for hackers. Stuff that matters.
Re:A 100LOC C impl of memset, that is faster than glibc's by josefx on Friday November 12, 2021 @09:21AM (#29199486)
> 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.

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.
Re:A 100LOC C impl of memset, that is faster than glibc's by bjourne on Saturday November 13, 2021 @06:16AM (#29209024)
Hilariously slow before Intel engineers decided to optimize the shit out of the construction. :)