MCPcopy Create free account
hub / github.com/angular/angular / record

Function record

packages/compiler-cli/preprocessor/ng-analyze/src/perf/tests.rs:86–122  ·  view source on GitHub ↗

Two queries polled on two threads, with a nested sync span and a dependency span.

(h: &Harness)

Source from the content-addressed store, hash-verified

84
85/// Two queries polled on two threads, with a nested sync span and a dependency span.
86fn record(h: &Harness) {
87 let (syntax, parse) = h.on_thread("a", || {
88 h.at(0);
89 let syntax = query(&QueryKey::AnalyzeFileSyntax(1));
90 h.at(10);
91 let poll = syntax.enter();
92 h.at(12);
93 let sync = tracing::info_span!("EmitWire").entered();
94 h.at(15);
95 // Requested inside the `emitWire` slice: flow start here.
96 let parse = query(&QueryKey::ParseFile(1));
97 let resolve = tracing::info_span!(target: "oxc_resolver", "resolve").entered();
98 h.at(16);
99 drop(resolve);
100 h.at(17);
101 drop(sync);
102 h.at(20);
103 drop(poll);
104 // Dropped before completing.
105 drop(query(&QueryKey::ParseFile(2)));
106 (syntax, parse)
107 });
108 h.on_thread("b", move || {
109 h.at(30);
110 parse.in_scope(|| h.at(34));
111 parse.record("done", true);
112 drop(parse);
113 h.at(40);
114 syntax.in_scope(|| h.at(43));
115 syntax.record("done", true);
116 h.at(50);
117 let analyze = tracing::info_span!(target: ASYNC_TARGET, "Analyze");
118 analyze.in_scope(|| h.at(52));
119 drop(analyze);
120 drop(syntax);
121 });
122}
123
124#[test]
125fn records_per_thread_slices_flows_and_totals() {

Calls 5

on_threadMethod · 0.80
enterMethod · 0.80
queryFunction · 0.70
recordMethod · 0.65
atMethod · 0.45

Tested by

no test coverage detected