- Add CLI support (--config, --help) with env var override for backend/agents - Implement distro justfile recipes: list-targets, install-targets, build-target, install - Fix OpenTelemetry API incompatibilities and remove deprecated calls - Add tokio "time" feature for timeout support - Fix Cargo profile warnings and Nushell script syntax - Update all dead_code warnings with strategic annotations - Zero compiler warnings in vapora codebase - Comprehensive CHANGELOG documenting risk-based approval gates system
66 lines
2.7 KiB
Rust
66 lines
2.7 KiB
Rust
use std::hint::black_box;
|
|
|
|
use criterion::{criterion_group, criterion_main, Criterion};
|
|
use vapora_tracking::parsers::{ClaudeTodoParser, MarkdownParser};
|
|
|
|
fn markdown_parse_changes_bench(c: &mut Criterion) {
|
|
let content = "---\nproject: vapora\nlast_sync: 2025-11-10T14:30:00Z\n---\n\n## \
|
|
2025-11-10T14:30:00Z - Implemented WebSocket sync\n**Impact**: backend | \
|
|
**Breaking**: no | **Files**: 5\nNon-blocking async synchronization using \
|
|
tokio channels.\n\n## 2025-11-09T10:15:00Z - Fixed database \
|
|
indices\n**Impact**: performance | **Breaking**: no | **Files**: 2\nOptimized \
|
|
query performance for tracking entries.\n\n## 2025-11-08T16:45:00Z - Added \
|
|
error context\n**Impact**: infrastructure | **Breaking**: no | **Files**: \
|
|
3\nImproved error messages with structured logging.\n";
|
|
|
|
c.bench_function("markdown_parse_changes_small", |b| {
|
|
b.iter(|| MarkdownParser::parse_changes(black_box(content), black_box("/test")))
|
|
});
|
|
}
|
|
|
|
fn markdown_parse_todos_bench(c: &mut Criterion) {
|
|
let content = "---\nproject: vapora\nlast_sync: 2025-11-10T14:30:00Z\n---\n\n## [ ] Implement \
|
|
webhook system\n**Priority**: H | **Estimate**: L | **Tags**: #feature \
|
|
#api\n**Created**: 2025-11-10T14:30:00Z | **Due**: 2025-11-15\nImplement \
|
|
bidirectional webhook system for real-time events.\n\n## [>] Refactor database \
|
|
layer\n**Priority**: M | **Estimate**: M | **Tags**: #refactor \
|
|
#database\n**Created**: 2025-11-08T10:00:00Z | **Due**: 2025-11-20\nImprove \
|
|
database abstraction and reduce code duplication.\n\n## [x] Setup CI/CD \
|
|
pipeline\n**Priority**: H | **Estimate**: S | **Tags**: \
|
|
#infrastructure\n**Created**: 2025-11-05T08:00:00Z\nGitHub Actions workflow \
|
|
for automated testing.\n";
|
|
|
|
c.bench_function("markdown_parse_todos_small", |b| {
|
|
b.iter(|| MarkdownParser::parse_todos(black_box(content), black_box("/test")))
|
|
});
|
|
}
|
|
|
|
fn claude_todo_parser_bench(c: &mut Criterion) {
|
|
let content = r#"[
|
|
{
|
|
"content": "Implement feature X",
|
|
"status": "pending"
|
|
},
|
|
{
|
|
"content": "Fix bug in parser",
|
|
"status": "in_progress"
|
|
},
|
|
{
|
|
"content": "Update documentation",
|
|
"status": "completed"
|
|
}
|
|
]"#;
|
|
|
|
c.bench_function("claude_todo_parse_small", |b| {
|
|
b.iter(|| ClaudeTodoParser::parse(black_box(content), black_box("/test")))
|
|
});
|
|
}
|
|
|
|
criterion_group!(
|
|
benches,
|
|
markdown_parse_changes_bench,
|
|
markdown_parse_todos_bench,
|
|
claude_todo_parser_bench
|
|
);
|
|
criterion_main!(benches);
|