(c: &mut Criterion)
| 750 | ]; |
| 751 | |
| 752 | fn bench_diagnostics_phpactor_fixtures(c: &mut Criterion) { |
| 753 | let mut group = c.benchmark_group("diagnostics"); |
| 754 | for name in DIAGNOSTIC_FIXTURES { |
| 755 | let path = format!("benches/fixtures/diagnostics/{name}.php"); |
| 756 | let content = |
| 757 | std::fs::read_to_string(&path).unwrap_or_else(|e| panic!("failed to read {path}: {e}")); |
| 758 | let uri = format!("file:///bench/{name}.php"); |
| 759 | |
| 760 | group.bench_with_input( |
| 761 | BenchmarkId::new("fixture", *name), |
| 762 | &content, |
| 763 | |b, content| { |
| 764 | let backend = Backend::new_test_with_full_stubs(); |
| 765 | backend.update_ast(&uri, content); |
| 766 | b.iter(|| { |
| 767 | let mut out = Vec::new(); |
| 768 | backend.collect_deprecated_diagnostics(&uri, black_box(content), &mut out); |
| 769 | backend.collect_unused_import_diagnostics(&uri, content, &mut out); |
| 770 | backend.collect_unknown_class_diagnostics(&uri, content, &mut out); |
| 771 | backend.collect_unknown_member_diagnostics(&uri, content, &mut out); |
| 772 | black_box(out) |
| 773 | }) |
| 774 | }, |
| 775 | ); |
| 776 | } |
| 777 | group.finish(); |
| 778 | } |
| 779 | |
| 780 | criterion_group!( |
| 781 | benches, |
nothing calls this directly
no test coverage detected