Skip to content

Use SeriesBuffer everywhere - #182

Merged
ferranbt merged 3 commits into
mainfrom
series-with-max-loopback
Aug 30, 2026
Merged

Use SeriesBuffer everywhere#182
ferranbt merged 3 commits into
mainfrom
series-with-max-loopback

Conversation

@ferranbt

Copy link
Copy Markdown
Owner

All the historical time series are capped at MAX_LOOKBACK (around 5000 bars). Most of the time series use the SeriesBuffer struct which uses an efficient circular buffer with Vecqueue. However, some other parts still used a plain Vec<> and inefficient functions to cap the vector.

This PR uses SeriesBuffer to represent all historical time series. The benchmark CI test might fail since I have updated the bench test cases and increase the number of bars being used to MAX_LOOPBACK*2 so it takes longer now. All in all, the improvement is around 5x.

@ferranbt ferranbt changed the title Series with max loopback Use SeriesBuffer everywhere Aug 30, 2026
@codspeed-hq

codspeed-hq Bot commented Aug 30, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 10 untouched benchmarks
🆕 5 new benchmarks
⏩ 64 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
🆕 interpreter/single_bar[complex] N/A 728.1 ms N/A
🆕 interpreter/single_bar[macd] N/A 444.8 ms N/A
🆕 interpreter/single_bar[moving_averages] N/A 427.2 ms N/A
🆕 interpreter/single_bar[rsi] N/A 299 ms N/A
🆕 interpreter/single_bar[simple] N/A 238 ms N/A

Comparing series-with-max-loopback (74358ac) with main (89631d6)

Open in CodSpeed

Footnotes

  1. 64 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@ferranbt
ferranbt merged commit 92a2e9c into main Aug 30, 2026
8 checks passed
@ferranbt
ferranbt deleted the series-with-max-loopback branch August 30, 2026 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant