MCPcopy Create free account
hub / github.com/PHPantom-dev/phpantom_lsp / bench_definition

Function bench_definition

benches/completion.rs:637–652  ·  view source on GitHub ↗
(c: &mut Criterion)

Source from the content-addressed store, hash-verified

635}
636
637fn bench_definition(c: &mut Criterion) {
638 let runtime = rt();
639 let source = r#"<?php
640class DefTarget {
641 public function action(): void {}
642}
643$dt = new DefTarget();
644$dt->action();
645"#;
646 let backend = Backend::new_test();
647 let uri = runtime.block_on(open_file(&backend, "file:///bench_def.php", source));
648
649 c.bench_function("goto_definition_method", |b| {
650 b.iter(|| runtime.block_on(fire_definition(&backend, &uri, 5, 7)))
651 });
652}
653
654// ─── Parse & reparse benchmarks ────────────────────────────────────────────
655

Callers

nothing calls this directly

Calls 4

rtFunction · 0.85
fire_definitionFunction · 0.85
iterMethod · 0.80
open_fileFunction · 0.70

Tested by

no test coverage detected