n8n/packages/testing/performance/vitest.config.ts
Declan Carroll c4ab0fff99
ci: Add performance benchmark regression detection to CI (#26156)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 15:52:04 +00:00

20 lines
661 B
TypeScript

import codspeedPlugin from '@codspeed/vitest-plugin';
import { defineConfig } from 'vitest/config';
export default defineConfig({
plugins: [process.env.CODSPEED ? codspeedPlugin() : null].filter(Boolean),
test: {
benchmark: {
include: ['benchmarks/**/*.bench.ts'],
// Run each benchmark longer for more stable results
// Default is 500ms - we use 1000ms for ~2x more samples
time: 1000,
// Warmup: ensure JIT compilation is complete before measuring
// Default is 5 iterations - we use 100 for more thorough warmup
warmupIterations: 100,
// Default warmup time is 100ms - we use 500ms for stability
warmupTime: 500,
},
},
});