-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(vitest-runner): add first implementation #26
Conversation
c4bc829
to
fd45354
Compare
CodSpeed Performance ReportMerging #26 will create unknown performance changesComparing Summary
Benchmarks breakdown
|
CodSpeed Performance ReportMerging #26 will improve performances by ×7Falling back to comparing 🎉 Hooray!
|
Benchmark | main |
feat/vitest-runner |
Change | |
---|---|---|---|---|
⚡ | String#indexOf |
135.5 µs | 14.2 µs | ×9.5 |
⚡ | switch 2 |
172.4 µs | 17.6 µs | ×9.8 |
⚡ | switch 1 |
155.2 µs | 17 µs | ×9.1 |
🆕 | long body |
N/A | 1.4 ms | N/A |
🆕 | short body 2 |
N/A | 481.8 µs | N/A |
🆕 | short body |
N/A | 502.7 µs | N/A |
🆕 | long body |
N/A | 1.6 ms | N/A |
🆕 | short body |
N/A | 262.3 µs | N/A |
⚡ | RegExp#test |
142.5 µs | 20.5 µs | ×7 |
🆕 | short body 4 |
N/A | 497.7 µs | N/A |
🆕 | long body |
N/A | 1.4 ms | N/A |
🆕 | short body |
N/A | 234.7 µs | N/A |
🆕 | short body 5 |
N/A | 222.8 µs | N/A |
🆕 | short body |
N/A | 502.9 µs | N/A |
🆕 | short body |
N/A | 500.5 µs | N/A |
🆕 | test_recursive_fibo_10 |
N/A | 170.7 µs | N/A |
🆕 | fibo 10 |
N/A | 161.8 µs | N/A |
🆕 | long body |
N/A | 1.4 ms | N/A |
🆕 | short body |
N/A | 388.5 µs | N/A |
🆕 | switch 1 |
N/A | 17 µs | N/A |
... | ... | ... | ... | ... |
ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.
5da75a7
to
7cf6320
Compare
9b00de0
to
55e3dce
Compare
fecec67
to
4d3591d
Compare
}; | ||
} | ||
|
||
export async function withCodSpeed( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would recommend implementing this as a plugin since this is how config is usually modified in the ecosystem:
// vitest.config.ts
import { CodeSpeedPlugin } from '@codespeed/vitest-runner'
import { defineConfig } from 'vitest/config'
export default defineConfig((mode) => ({
plugins: [mode === 'benchmark' ? CodeSpeedPlugin() : null]
}))
// plugin.ts
export default () => {
return {
name: 'codespeed:vitest'
config() {
// you don't need to merge it yourself, just return modified version
return {
test: {
poolOptions: {
forks: {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore - remove when https://github.com/vitest-dev/vitest/pull/4383 is merged and released
execArgv: getV8Flags(),
},
},
runner: `${__dirname}/runner.es5.js`,
globalSetup: [
`${__dirname}/globalSetup.es5.js`,
],
}
}
}
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion, I implemented it in the new PR #28
No description provided.