jonhoo / atone

A `VecDeque` (and `Vec`) variant that spreads resize load across pushes.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Customize the number of elements moved for each push

Lol3rrr opened this issue · comments

commented

It seems like the number of elements moved in each push after a resize is set to a constant value, which only depends on testing/miri.

It could be worth it to consider having an "inner" type that has a const generic that specifies the number of elements used and then just use a type alias for the currently exposed configuration. This would allow users of the crate to choose their own value, when it makes sense for them to diverge from the default choice as they see fit for their use case.

Rough idea

Currently it only exposes Vc with a move size of 8 (or 4 for testing).
Instead we could change Vc to VcCustom<const R: usize> and add a type alias like type Vc = VcCustom<8>, while exposing both to the user