Skip to content

feat(benchmark)!: rewrite the public API - #10113

Merged
sheremet-va merged 94 commits into
vitest-dev:mainfrom
sheremet-va:feat/rewrite-benchmarks
May 29, 2026
Merged

sheremet-va merged 94 commits into
vitest-dev:mainfrom
sheremet-va:feat/rewrite-benchmarks

Conversation

@sheremet-va

@sheremet-va sheremet-va commented Apr 9, 2026

Copy link
Copy Markdown
Member

Related #7850

New API as part of the test instead of being a test:

import { expect, test } from 'vitest'

test('compare JSON libraries', async ({ bench }) => {
  const input = '{"key":"value","nested":{"a":1}}'

  const result = await bench.compare(
    bench('JSON.parse', () => {
      JSON.parse(input)
    }),
    bench('custom parser', () => {
      customParse(input)
    }),
  )
})

@sheremet-va sheremet-va changed the title Feat/rewrite benchmarks feat(benchmark): rewrite the public API Apr 9, 2026
@netlify

netlify Bot commented Apr 9, 2026

Copy link
Copy Markdown

Deploy Preview for vitest-dev ready!

Name Link
🔨 Latest commit 50c3d40
🔍 Latest deploy log https://app.netlify.com/projects/vitest-dev/deploys/6a18203eb945a30008741713
😎 Deploy Preview https://deploy-preview-10113--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@sheremet-va
sheremet-va marked this pull request as ready for review May 22, 2026 12:50

@hi-ogawa hi-ogawa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

did surface level check. the api looks good.
will read new part of implementation nexy later.

Comment thread docs/guide/benchmarking.md Outdated
Comment thread packages/vitest/src/node/benchmark.ts Outdated
Comment thread test/e2e/vitest.config.ts
Comment thread docs/guide/benchmarking.md Outdated
Comment thread packages/vitest/src/node/config/serializeConfig.ts Outdated
@sheremet-va
sheremet-va requested a review from hi-ogawa May 27, 2026 12:06

@hi-ogawa hi-ogawa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm! left minor reviews.

Comment thread test/e2e/test/benchmarking.test-d.ts
Comment thread docs/guide/benchmarking.md Outdated
Comment thread docs/guide/benchmarking.md Outdated
@sheremet-va
sheremet-va requested a review from hi-ogawa May 28, 2026 11:00
@sheremet-va
sheremet-va merged commit 19f6e89 into vitest-dev:main May 29, 2026
15 of 18 checks passed
@sheremet-va
sheremet-va deleted the feat/rewrite-benchmarks branch May 29, 2026 11:05
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants