4 ms·
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 furth
by irishsultan 5y ago
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.
- qw3rty01 5y agoIt does clone: https://stdrs.dev/nightly/x86_64-pc-windows-gnu/src/alloc/vec/mod.rs.html#2205-2212 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.