WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@alantreadway
Copy link
Member

This PR adds comprehensive benchmarks for high-frequency data scenarios across multiple chart series types.

Changes

  • Added high-frequency data benchmarks for bar series (community)
  • Added high-frequency data benchmarks for candlestick series (enterprise)
  • Added high-frequency data benchmarks for OHLC series (enterprise)
  • Updated high-frequency data benchmarks for line series (community)
  • Added corresponding example files for all benchmark types
  • Updated project.json configurations for benchmark example generation

Reviewers

This PR should be reviewed by the Charts dev team as it focuses on benchmark additions and library functionality.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

benchmark(
'10x append batch (1k points total)',
ctx.repeatCount(10),
{ expectedRelativeMB: 0.5, expectedCanvasCount: 2, autoSnapshot: false },
async () => {
const append = createBatch(BATCH_SIZE);
data = data.concat(append);
await (ctx.chart as any).applyTransaction({ append });
},
30_000
);
benchmark(
'1x remove batch (100 points)',
ctx,
{ expectedRelativeMB: 0.5, expectedCanvasCount: 2, autoSnapshot: false },
async () => {
const remove = data.slice(0, BATCH_SIZE);
data = data.slice(BATCH_SIZE);
await (ctx.chart as any).applyTransaction({ remove });
},
15_000
);
benchmark(
'1x rolling window update (append + remove)',
ctx,
{ expectedRelativeMB: 0.5, expectedCanvasCount: 2, autoSnapshot: false },

P1 Badge Reset repeat count before single-run benchmarks

After calling ctx.repeatCount(10) for the "10x append batch" test, the same BenchmarkContext is reused for the subsequent "1x remove" and "1x rolling window" cases without resetting repeat. repeatCount mutates the context and the benchmark helper reads ctx.repeat directly, so both "1x" tests are actually executed ten times each. That inflates timings and memory measurements and risks timeouts. Reset the repeat count (e.g. ctx.repeatCount(1)) before the single-run benchmarks, and apply the same fix to the bar/candlestick/ohlc high-frequency tests which follow the same pattern.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

After calling ctx.repeatCount(10) for the 10x append batch test, reset
the repeat count to 1 before subsequent 1x tests to prevent them from
running 10 times. This fixes inflated timings and memory measurements.

Applied to all high-frequency benchmark files: line, bar, candlestick, and OHLC.
@alantreadway
Copy link
Member Author

💡 Codex Review

benchmark(
'10x append batch (1k points total)',
ctx.repeatCount(10),
{ expectedRelativeMB: 0.5, expectedCanvasCount: 2, autoSnapshot: false },
async () => {
const append = createBatch(BATCH_SIZE);
data = data.concat(append);
await (ctx.chart as any).applyTransaction({ append });
},
30_000
);
benchmark(
'1x remove batch (100 points)',
ctx,
{ expectedRelativeMB: 0.5, expectedCanvasCount: 2, autoSnapshot: false },
async () => {
const remove = data.slice(0, BATCH_SIZE);
data = data.slice(BATCH_SIZE);
await (ctx.chart as any).applyTransaction({ remove });
},
15_000
);
benchmark(
'1x rolling window update (append + remove)',
ctx,
{ expectedRelativeMB: 0.5, expectedCanvasCount: 2, autoSnapshot: false },

P1 Badge Reset repeat count before single-run benchmarks

Fixed.

Copy link
Member

@manapeirov manapeirov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alantreadway alantreadway merged commit 6ebda26 into latest Nov 8, 2025
31 checks passed
@alantreadway alantreadway deleted the ag-16239/high-freq-benchmarks branch November 8, 2025 16:23
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.

3 participants