MCPcopy Index your code
hub / github.com/angular/angular / storePerformanceLogOfCurrentRun

Function storePerformanceLogOfCurrentRun

modules/ssr-benchmarks/run-benchmark.ts:100–118  ·  view source on GitHub ↗
(measures: Map<string, number[]>)

Source from the content-addressed store, hash-verified

98 * Each entry is sorted, which will make the map keys sorted by startTime
99 */
100export function storePerformanceLogOfCurrentRun(measures: Map<string, number[]>) {
101 const perfEntries = performance.getEntriesByType('measure');
102 perfEntries.sort((a, b) => a.startTime - b.startTime);
103
104 for (const {name, duration} of perfEntries) {
105 if (!name.startsWith(PERFORMANCE_MARK_PREFIX)) {
106 continue;
107 }
108
109 const measure = measures.get(name);
110 if (!measure) {
111 measures.set(name, [duration]);
112 } else {
113 measure.push(duration);
114 }
115
116 performance.clearMeasures(name);
117 }
118}

Callers 1

benchmarkRunFunction · 0.85

Calls 3

getMethod · 0.65
setMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…