RFC: Remove aligned-vec dependency#51
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #51 +/- ##
==========================================
+ Coverage 94.27% 94.48% +0.20%
==========================================
Files 3 4 +1
Lines 332 453 +121
==========================================
+ Hits 313 428 +115
- Misses 19 25 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
2df74a5 to
d05f143
Compare
|
Of course the performance regresses now... let me investigate. |
also seal it so downstream can't implement it
This lets us drop our dependency on aligned-vec.
d05f143 to
80b1585
Compare
|
Okay, ready now. If we include #52 then there is no performance regression on my machine. As a bonus, |
80b1585 to
d53a34f
Compare
| ); | ||
|
|
||
| for (new, old) in new.iter_mut().zip(self.iter()) { | ||
| new.write(old.clone()); |
There was a problem hiding this comment.
I wonder if we can make a specialized impl for T: Copy that uses copy_nonoverlapping (or copy_from_slice) instead. Should be even faster if your other PR is any indication.
There was a problem hiding this comment.
Speed seems to be about the same on my machine for a Plane::clone() vs a plane.copy_from_slice(&data) from the benches. Roughly 35-40 microseconds, so I think the compiler already catches it in this case.
There was a problem hiding this comment.
It seems to not be guaranteed. There may just not be any places using it in a performance critical way in this crate. Nevertheless since I'm already testing it, I may as well push up a specialization for it.
Iterator method generates a loop:
.LBB3_5:
movzx edx, byte ptr [r14 + rcx]
mov byte ptr [rax + rcx], dl
inc rcx
cmp rbx, rcx
jne .LBB3_5
jmp .LBB3_6
.LBB3_1:
mov eax, 1copy_nonoverlapping generating a memcpy:
.LBB3_1:
mov edi, 1
.LBB3_4:
mov rsi, r14
mov rdx, rbx
mov r14, rdi
call qword ptr [rip + memcpy@GOTPCREL]There was a problem hiding this comment.
Apparently specialization is still not stable. WTF Rust it's been like 8 years.
There was a problem hiding this comment.
I thought you had some neat trick up your sleeve 🥲
I think specialization is still some time away too.. would've been nice to have, but oh well
Motivation:
Footnotes
cases of UB should not concern v_frame ↩