3 ms·
It seems that you do know what I mean by part. Only the latest Zen3 parts have ERMS and FSRM. I think that benchmarking memset by itself is folly, because you
by jeffbee 6y ago
It seems that you do know what I mean by part. Only the latest Zen3 parts have ERMS and FSRM.
I think that benchmarking memset by itself is folly, because you may end up with a very large function that is fast on its own, but which trashes your icache when run in a real application. That is the conclusion of the paper I linked elsewhere in this thread: that rep cmpsb, even on old CPUs where it is slow, beats glibc memcmp in real full-scale applications because glibc memcmp is 6KB long and has a tendency to evict dozens of lines of icache. memset, memcpy, and memmove have the same hazard.
- moonchild 6y agoThat is a good point, and I do intend to do full-scale application benchmarks; I just haven't gotten around to it yet. That being said, all the implementations of memset I tested except for glibc's are in the neighborhood of 100-300 bytes (also including the freebsd version, which doesn't use any simd), which is a fair sight smaller than 6k.