JuliaCollections / JuliaCollections/DataStructures.jl

N-dimensional (pre-allocating) circular buffer

Open
#223 14 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
745
Forks
261
PR merge metrics
No merged PRs in 30d

Description

Hello,

I noticed that current implementation of circular buffer is only 1 dimension.

A generalized approach of this problem will be nice (especially for implementing streaming timeseries)

So, instead of pushing a single value in a 1D circular buffer,

  • it will be possible to push an Array{T,1} in a 2D circular buffer
  • it will be possible to push an Array{T,2} in a 3D circular buffer
  • it will be possible to push an Array{T,N-1} in a N-D circular buffer

I also noticed that current implementation of circular buffer is using a Vector with size increasing (until capacity is reached). Maybe pre-allocating array will be a more efficient approach ?

@tbreloff I noticed you are original author.
What is your opinion about this ?

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 current circular-buffer implementation and its tests; the issue names no files or test entry points. Read how values are pushed and capacity is handled before defining the scope. Done would require an agreed design for N-dimensional pushes and pre-allocation, plus tests covering both behaviors.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.