orxfun / orxfun/orx-split-vec

Extend Performance Optimization

Open
#21 0 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.