-
-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Current Extend implementation of the SplitVec is only for convenience rather than for performance. The implementation looks as below
impl<T, G> Extend<T> for SplitVec<T, G>
where
G: Growth,
{
fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I) {
for x in iter {
self.push(x);
}
}
}std::vec::Vec implementation, however, uses is optimized with special extend traits. With some book keeping and with the use of size hints, SplitVec can directly call std::vec::Vec::extend method and indirectly utilize these optimizations rather than pushing each element one after the other.
Metadata
Metadata
Assignees
Labels
No labels