Skip to content
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

Remove analyzer error from benchmark #1168

Merged
merged 1 commit into from
Dec 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion crates/tests/benches/benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ use veryl_parser::Parser;
#[cfg(target_os = "linux")]
mod perf;

const EXCLUDES: [&str; 2] = [r"52_include.veryl", r"67_cocotb.veryl"];
const EXCLUDES: [&str; 4] = [
r"25_dependency.veryl",
r"52_include.veryl",
r"67_cocotb.veryl",
r"68_std.veryl",
];

fn criterion_benchmark(c: &mut Criterion) {
let mut text = String::new();
Expand All @@ -23,6 +28,20 @@ fn criterion_benchmark(c: &mut Criterion) {
let metadata_path = Metadata::search_from_current().unwrap();
let metadata = Metadata::load(&metadata_path).unwrap();

// Check no analyzer error
let parser = Parser::parse(&text, &"").unwrap();
let prj = &metadata.project.name;
let analyzer = Analyzer::new(&metadata);
let mut errors = Vec::new();
errors.append(&mut analyzer.analyze_pass1(prj, &text, &"", &parser.veryl));
Analyzer::analyze_post_pass1();
errors.append(&mut analyzer.analyze_pass2(prj, &text, &"", &parser.veryl));
errors.append(&mut analyzer.analyze_pass3(prj, &text, &"", &parser.veryl));
if !errors.is_empty() {
dbg!(errors);
assert!(false);
}

let mut group = c.benchmark_group("throughput");
group.throughput(Throughput::Bytes(text.len() as u64));
group.bench_function("parse", |b| {
Expand Down
Loading