Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,28 @@ bench.concurrency = 'task' // The concurrency mode to determine how tasks are ru
await bench.run()
```

## Retaining Samples

By default Tinybench does not keep the samples for `latency` and `throughput` to
minimize memory usage. Enable sample retention if you need the raw samples for
plotting, custom analysis, or exporting results.

You can enable samples retention at the bench level by setting the
`retainSamples` option to `true` when creating a `Bench` instance:

```ts
const bench = new Bench({ retainSamples: true })
```

You can also enable samples retention by setting the `retainSamples` option to
`true` when adding a task:

```ts
bench.add('task with samples', () => {
// Task logic here
}, { retainSamples: true })
```

## Aborting Benchmarks

Tinybench supports aborting benchmarks using `AbortSignal` at both the bench and task levels:
Expand Down
2 changes: 1 addition & 1 deletion docs/assets/hierarchy.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/assets/navigation.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/assets/search.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading