lewton icon indicating copy to clipboard operation
lewton copied to clipboard

Switch to using smallvec over tinyvec

Open james7132 opened this issue 3 years ago • 2 comments

smallvec seems to be in much higher use than tinyvec, so adding tinyvec tends to increase the amount of work while using lewton as a dependency in a typical build. This PR replaces tinyvec with smallvec as a drop-in replacement.

james7132 avatar Jun 04 '22 03:06 james7132

See the reasons why tinyvec was adopted: #75 . It's 100% safe. But yeah 52 dependents vs 759 dependents...

est31 avatar Jun 04 '22 13:06 est31

I'm not too familiar with the operations being done with the type, but it does seem like it's collecting some kind of stream of bools into a temporary buffer of some kind.

Is the number of elements here bounded? If so, I could switch this to use a on-stack bitset instead, eliminating the dependency entirely.

Otherwise, I'm still going to insist on using smallvec here. I'm trying to minimize the dependency tree of Bevy, which depends transitively on this crate through rodio. This is the only instance of tinyvec in the entire dependency tree, while there are at least 6 uses of smallvec elsewhere.

james7132 avatar Jun 04 '22 15:06 james7132