News for hackers. Stuff that matters.
Re:A 100LOC C impl of memset, that is faster than glibc's by jeffbee on Friday November 12, 2021 @03:05PM (#29203945)
As far as real-world performance goes, this paper claims (and shows) that code size is the relevant aspect of mem* functions, and concludes that `rep stosb` is optimal in practice, even though it obviously loses to exotic hand-rolled memset and memcmp in microbenchmarks.

https://storage.googleapis.com/pub-tools-public-publication-...

Re:A 100LOC C impl of memset, that is faster than glibc's by ckennelly on Friday November 12, 2021 @09:16PM (#29206767)
https://research.google/pubs/pub50338.pdf goes into more depth on the mem* libc functions and principles for the implementations in llvm libc.
Re:A 100LOC C impl of memset, that is faster than glibc's by stephencanon on Friday November 12, 2021 @03:38PM (#29204250)
rep stos _is_ worth using, but that paper makes no mention of it (it does show that in their use rep cmps beat a more complicated memcmp implementation).