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

Function processFile

packages/compiler-cli/preprocessor/test/perf_spec.ts:163–174  ·  view source on GitHub ↗
(path: string, delayMs: number)

Source from the content-addressed store, hash-verified

161 it('records overlapping per-file work as async slices with file ids', async () => {
162 const tracer = createTracer();
163 const processFile = async (path: string, delayMs: number) => {
164 const fileId = tracer.newFileId(path);
165 try {
166 await new Promise((resolve) => setTimeout(resolve, delayMs));
167 tracer.slice(SpanKind.SourceMap, () => {}, fileId);
168 tracer.asyncBegin(SpanKind.WriteOutput, fileId);
169 await new Promise((resolve) => setTimeout(resolve, 1));
170 tracer.asyncEnd(SpanKind.WriteOutput, fileId);
171 } finally {
172 tracer.asyncEnd(SpanKind.File, fileId);
173 }
174 };
175 await Promise.all([processFile('/a.ts', 5), processFile('/b.ts', 1)]);
176
177 const {events, summary} = tracer.take();

Callers 1

perf_spec.tsFile · 0.70

Calls 5

setTimeoutFunction · 0.85
newFileIdMethod · 0.65
sliceMethod · 0.65
asyncBeginMethod · 0.65
asyncEndMethod · 0.65

Tested by

no test coverage detected