Skip to content

Conversation

@Uzlopak
Copy link
Collaborator

@Uzlopak Uzlopak commented Nov 10, 2025

fixes #61

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 10, 2025

Open in StackBlitz

npm i https://pkg.pr.new/tinylibs/tinybench@421

commit: c8fd0be

@github-actions
Copy link

github-actions bot commented Nov 10, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
dist/index.js 9.76 KB (+0.6% 🔺) 196 ms (+0.6% 🔺) 14 ms (+298.56% 🔺) 210 ms

@Uzlopak Uzlopak requested a review from Copilot November 10, 2025 20:24
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR reduces memory usage by replacing full sample arrays with sample counts in the Statistics interface, addressing issue #61 related to data retention.

Key Changes:

  • Modified Statistics interface to store only samplesCount: number instead of samples: number[]
  • Updated getStatisticsSorted() to return sample count instead of the full array
  • Updated all tests and console table formatting to use samplesCount

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/types.ts Changed Statistics interface to replace samples array with samplesCount number
src/utils.ts Updated getStatisticsSorted() to return samplesCount: samples.length and console table converter to use new property
src/task.ts Added type annotation for throughputSamples and GC-related assignments (though the latter are not functionally necessary)
test/statistics.test.ts Updated test assertions to check samplesCount type instead of array validation
test/concurrency-iteration-limit.test.ts Updated test assertions to check samplesCount value instead of array length

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <[email protected]>
@Uzlopak Uzlopak changed the title perf: reduce data retention perf!: reduce data retention Nov 10, 2025
43081j
43081j previously approved these changes Nov 10, 2025
@Uzlopak Uzlopak changed the title perf!: reduce data retention perf!: reduce data retention, by adding retainSamples option on bench and task level Nov 11, 2025
@Uzlopak Uzlopak changed the title perf!: reduce data retention, by adding retainSamples option on bench and task level perf!: reduce data retention, by adding retainSamples option on bench and task level, default is no samples retention Nov 11, 2025
@Uzlopak
Copy link
Collaborator Author

Uzlopak commented Nov 11, 2025

@jerome-benoit

I made the data retention now configurable
the only question stays: should be the default to retain or not to retain data. I think not retaining is the normal use case. If somebody wants to retain the data it is possible to configure it. So it would be just a breaking change, that the samples is not set.

Do you have arguments against no data retention by default?

@Uzlopak Uzlopak changed the title perf!: reduce data retention, by adding retainSamples option on bench and task level, default is no samples retention perf: allow reducing data retention, by adding retainSamples option on bench and task level, default is samples retention Nov 12, 2025
@Uzlopak Uzlopak requested a review from Copilot November 12, 2025 08:40
@Uzlopak Uzlopak changed the title perf: allow reducing data retention, by adding retainSamples option on bench and task level, default is samples retention perf: allow reducing data retention, by adding retainSamples option on bench and task level, default is true Nov 12, 2025
Copilot finished reviewing on behalf of Uzlopak November 12, 2025 08:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Uzlopak Uzlopak force-pushed the reduce-data-retention branch from 7bbb272 to ea031f3 Compare November 12, 2025 16:22
@Uzlopak Uzlopak changed the title perf: allow reducing data retention, by adding retainSamples option on bench and task level, default is true perf!: allow reducing data retention, by adding retainSamples option on bench and task level, default is true Nov 15, 2025
@Uzlopak Uzlopak requested a review from Copilot November 15, 2025 21:15
Copilot finished reviewing on behalf of Uzlopak November 15, 2025 21:16
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 52 out of 53 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <[email protected]>
@Uzlopak Uzlopak changed the title perf!: allow reducing data retention, by adding retainSamples option on bench and task level, default is true perf!: allow reducing data retention, by adding retainSamples option on bench and task level, default is false Nov 15, 2025
@Uzlopak Uzlopak enabled auto-merge November 21, 2025 09:01
@Uzlopak Uzlopak disabled auto-merge November 21, 2025 09:01
@Uzlopak Uzlopak merged commit 572d9b6 into main Nov 21, 2025
39 checks passed
@Uzlopak Uzlopak deleted the reduce-data-retention branch November 21, 2025 09:01
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.

Excessive data retention on fast benchmarks

4 participants