refactor: new rawsmallvec representation - #590
Conversation
|
will solve it tomorrow |
|
Hey Good Idea but this 5 lines kept repeating in the changes: if on_heap {
self.raw.as_heap()
} else {
self.raw.as_inline()
}Why not use a refactored/compatible as_ptr(on_heap) and as_mut_ptr(on_heap) instead? |
|
yeah I haven't done that yet, I wanted to first do it that way and check it works doing so that way erases the length of the array on type data on the inline variant so I was pretty reluctant to do so at first |
|
great... I killed something and I don't know why |
|
I need a few more days for this @fereidani this is a bombshell to how we represent the rawsmallvec, would be grateful I you could provide integration support to make sure that this lands correctly just fixed a bunch of test errors because of some mistake I made whilst remaking |
|
Sure thing, Let me know where I could help. |
|
I've been working on it, but it's unmergeable with how head has changed furthermore, it seems performance regresses, so I think it'd be better to throw it away |
|
@alejandro-vaz have you tried enum SmallVec { Stack(...), Heap(Vec) } solution? I have a feeling we can achieve good optimizations with it. Moving all our api specialized for stack vec and when on Vec simply use alloc provided functions instead. |
|
that's interesting, I haven't, but it makes sense I'll prototype it as well |
|
I have a few prototypes, I'm going to develop them a bit more to be sure of the conclusions |
this PR is a draft
closes #583
closes #441