News for hackers. Stuff that matters.
Re:Leveraging Zig's Allocators by astrange on Saturday June 15, 2024 @04:46PM (#40692583)
You can use non-temporal writes to avoid this, and some CPUs have an instruction that zeroes a cache line. It's not expensive to do this.
Re:Leveraging Zig's Allocators by celrod on Saturday June 15, 2024 @07:51PM (#40693543)
Nontemporal writes are substantially slower, e.g. with avx512 you can do 1 64 byte nontemporal write every 5 or so clock cycles. That puts you at >= 640 cycles for 8 KiB. https://uops.info/html-instr/VMOVNTPS_M512_ZMM.html
Re:Leveraging Zig's Allocators by astrange on Saturday June 15, 2024 @10:10PM (#40694192)
Well, the point of a non-temporal write kind of is that you don't care how fast it is. (Since if it was being read again anytime soon, you'd want it in the cache.)

But yes, it can be an over-optimization.