News for hackers. Stuff that matters.
Re:When zero cost abstractions aren't zero cost by qw3rty01 on Monday August 09, 2021 @10:52PM (#28124727)
This definitely brings it closer, but on my machine, touching the entire array still ends up being 2 seconds slower (5.4s for the calloc side, 7.8s for the clone side)
Re:When zero cost abstractions aren't zero cost by irishsultan on Tuesday August 10, 2021 @03:15AM (#28125954)
It's not using clone but memset. Of course memsetting memory to 0 when the operating system already set it to 0 is still silly and something that could be further optimized, but it's not cloning things.
Re:When zero cost abstractions aren't zero cost by qw3rty01 on Wednesday August 11, 2021 @01:23PM (#28144906)
It does clone: https://stdrs.dev/nightly/x86_64-pc-windows-gnu/src/alloc/ve...

it might be optimized to a memset, but it's the clone codepath, as opposed to the u8 specialization codepath as discussed in the article

But the original commenter is talking about how the benchmark isn't useful because it doesn't touch memory, but you get similar results even if you do touch memory.