mitchelloharawild / mitchelloharawild/vecvec
Leverage ALTREP class for replicated vectors
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 4
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
When replicating vecvec objects, the positional index can be more efficiently represented by storing the number of replicates.
z <- rep(1, 1e6)
pryr::object_size(z)
#> 8.00 MB
Created on 2026-05-27 with reprex v2.1.1
an 'alt rep' ALTREP class 😉 would make vecvec substantially more efficient within data analysis workflows, since the positional index of copies is often replications of regular ALTREP sequences.
For example, in mixtime you might have 1e6 time series for the exact same 1000 time points, for a total of 1e9 time points. The vecvec positions for this scenario would be rep(1:1000, 1e6)), which cannot currently be represented with ALTREP (requiring 8GB of memory!). This could (hopefully) be represented in just a few bytes with an ALTREP sequence for 1:1000, which is referenced in an ALTREP replication that additionally stores the number of replicates, 1e6.
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 vecvec replication path and reading how positional indexes are represented, then review R's ALTREP class interfaces. Use the issue's rep(1:1000, 1e6) example as the target case; done means the repeated index can be represented without materializing all positions while preserving vecvec behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data, performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100