Extend Performance Optimization
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 3
- Forks
- 5
- Avg merge
- 1h 40m
- Merged PRs (30d)
- 11
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the Extend implementation for SplitVec and read how its storage and growth bookkeeping work. Compare it with std::vec::Vec's Extend implementation and size-hint behavior. Done means extending through the underlying Vec operations while preserving SplitVec behavior and improving the current element-by-element approach.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- performance
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100