feat: add comprehensive performance benchmark tracking system

- Create benchmark test suites for critical operations:
  - Node loading performance
  - Database query performance
  - Search operations performance
  - Validation performance
  - MCP tool execution performance

- Add GitHub Actions workflow for benchmark tracking:
  - Runs on push to main and PRs
  - Uses github-action-benchmark for historical tracking
  - Comments on PRs with performance results
  - Alerts on >10% performance regressions
  - Stores results in GitHub Pages

- Create benchmark infrastructure:
  - Custom Vitest benchmark configuration
  - JSON reporter for CI results
  - Result formatter for github-action-benchmark
  - Performance threshold documentation

- Add supporting utilities:
  - SQLiteStorageService for benchmark database setup
  - MCPEngine wrapper for testing MCP tools
  - Test factories for generating benchmark data
  - Enhanced NodeRepository with benchmark methods

- Document benchmark system:
  - Comprehensive benchmark guide in docs/BENCHMARKS.md
  - Performance thresholds in .github/BENCHMARK_THRESHOLDS.md
  - README for benchmarks directory
  - Integration with existing test suite

The benchmark system will help monitor performance over time and catch regressions before they reach production.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
czlonkowski
2025-07-28 22:45:09 +02:00
parent 0252788dd6
commit b5210e5963
52 changed files with 6843 additions and 16 deletions

View File

@@ -0,0 +1,21 @@
import { Factory } from 'fishery';
import { faker } from '@faker-js/faker';
import { ParsedNode } from '../../src/parsers/node-parser';
export const NodeFactory = Factory.define<ParsedNode>(() => ({
nodeType: faker.helpers.arrayElement(['nodes-base.', 'nodes-langchain.']) + faker.word.noun(),
displayName: faker.helpers.arrayElement(['HTTP', 'Slack', 'Google', 'AWS']) + ' ' + faker.word.noun(),
description: faker.lorem.sentence(),
packageName: faker.helpers.arrayElement(['n8n-nodes-base', '@n8n/n8n-nodes-langchain']),
category: faker.helpers.arrayElement(['transform', 'trigger', 'output', 'input']),
style: faker.helpers.arrayElement(['declarative', 'programmatic']),
isAITool: faker.datatype.boolean(),
isTrigger: faker.datatype.boolean(),
isWebhook: faker.datatype.boolean(),
isVersioned: faker.datatype.boolean(),
version: faker.helpers.arrayElement(['1.0', '2.0', '3.0', '4.2']),
documentation: faker.datatype.boolean() ? faker.lorem.paragraphs(3) : undefined,
properties: [],
operations: [],
credentials: []
}));

View File

@@ -0,0 +1,28 @@
import { Factory } from 'fishery';
import { faker } from '@faker-js/faker';
interface PropertyDefinition {
name: string;
displayName: string;
type: string;
default?: any;
required?: boolean;
description?: string;
options?: any[];
}
export const PropertyDefinitionFactory = Factory.define<PropertyDefinition>(() => ({
name: faker.helpers.camelCase(faker.word.noun() + ' ' + faker.word.adjective()),
displayName: faker.helpers.arrayElement(['URL', 'Method', 'Headers', 'Body', 'Authentication']),
type: faker.helpers.arrayElement(['string', 'number', 'boolean', 'options', 'json']),
default: faker.datatype.boolean() ? faker.word.sample() : undefined,
required: faker.datatype.boolean(),
description: faker.lorem.sentence(),
options: faker.datatype.boolean() ? [
{
name: faker.word.noun(),
value: faker.word.noun(),
description: faker.lorem.sentence()
}
] : undefined
}));