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

Function bench_completion_chained_methods

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

Source from the content-addressed store, hash-verified

408}
409
410fn bench_completion_chained_methods(c: &mut Criterion) {
411 let runtime = rt();
412 let source = r#"<?php
413class Builder {
414 public function a(): self {}
415 public function b(): self {}
416 public function c(): self {}
417 public function d(): self {}
418 public function e(): self {}
419 public function finish(): string {}
420}
421$b = new Builder();
422$b->a()->b()->c()->d()->e()->
423"#;
424 let backend = Backend::new_test();
425 let uri = runtime.block_on(open_file(&backend, "file:///bench_chain.php", source));
426
427 c.bench_function("completion_5_method_chain", |b| {
428 b.iter(|| runtime.block_on(fire_completion(&backend, &uri, 11, 30)))
429 });
430}
431
432fn bench_cross_file_completion(c: &mut Criterion) {
433 let runtime = rt();

Callers

nothing calls this directly

Calls 4

rtFunction · 0.85
fire_completionFunction · 0.85
iterMethod · 0.80
open_fileFunction · 0.70

Tested by

no test coverage detected