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

Function bench_hover

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

Source from the content-addressed store, hash-verified

613// ─── Hover & go-to-definition benchmarks ───────────────────────────────────
614
615fn bench_hover(c: &mut Criterion) {
616 let runtime = rt();
617 let source = r#"<?php
618class HoverTarget {
619 /**
620 * Compute a result from the input.
621 * @param string $input The raw input
622 * @return int The computed value
623 */
624 public function compute(string $input): int {}
625}
626$ht = new HoverTarget();
627$ht->compute('test');
628"#;
629 let backend = Backend::new_test();
630 let uri = runtime.block_on(open_file(&backend, "file:///bench_hover.php", source));
631
632 c.bench_function("hover_method_call", |b| {
633 b.iter(|| runtime.block_on(fire_hover(&backend, &uri, 10, 7)))
634 });
635}
636
637fn bench_definition(c: &mut Criterion) {
638 let runtime = rt();

Callers

nothing calls this directly

Calls 4

rtFunction · 0.85
fire_hoverFunction · 0.85
iterMethod · 0.80
open_fileFunction · 0.70

Tested by

no test coverage detected