This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

+116
View File
@@ -0,0 +1,116 @@
// Metro module 10354 (f10355).
import { Profiler, useCallback } from "react";
let c6929_3, c6929_4;
class StatCollector {
constructor() {
return {
__proto__: new.target.prototype,
totalMicroseconds: 0,
count: 0,
minMicroseconds: null,
maxMicroseconds: null
};
}
addValue(a0) {
this.count = this.count + 1;
const r6 = Math.round(1000 * a0);
this.totalMicroseconds = this.totalMicroseconds + r6;
const r14 = Math;
let minMicroseconds = this.minMicroseconds;
if (minMicroseconds == null) {
minMicroseconds = Number.MAX_SAFE_INTEGER;
}
this.minMicroseconds = r14.min(minMicroseconds, r6);
const r18 = Math;
let maxMicroseconds = this.maxMicroseconds;
if (maxMicroseconds == null) {
maxMicroseconds = Number.MIN_SAFE_INTEGER;
}
this.maxMicroseconds = r18.max(maxMicroseconds, r6);
}
get mean() {
return this.totalMicroseconds / this.count;
}
}
c6929_3 = {};
c6929_4 = true;
export default function ComponentProfiler(props) {
const { id, children } = props;
return <Profiler id={id} onRender={useCallback((a0, a1, a2) => {
if (c6929_4) {
if (!(a0 in c6929_3)) {
c6929_3[a0] = {
mount: {
__proto__: StatCollector.prototype,
totalMicroseconds: 0,
count: 0,
minMicroseconds: null,
maxMicroseconds: null
},
update: {
__proto__: StatCollector.prototype,
totalMicroseconds: 0,
count: 0,
minMicroseconds: null,
maxMicroseconds: null
},
nestedUpdate: {
__proto__: StatCollector.prototype,
totalMicroseconds: 0,
count: 0,
minMicroseconds: null,
maxMicroseconds: null
}
};
}
if (a1 === "mount") {
c6929_3[a0].mount.addValue(a2);
} else if (a1 === "update") {
c6929_3[a0].update.addValue(a2);
} else if (a1 === "nested-update") {
c6929_3[a0].nestedUpdate.addValue(a2);
}
}
}, [])}>{children}</Profiler>;
};
export { StatCollector };
export function clearComponentRenderStats() {
c6929_3 = {};
}
export function getComponentRenderStats() {
return c6929_3;
}
export function serializeComponentRenderAverages() {
const length = Object.keys(c6929_3).length;
const r34 = length !== 0 ? "Component Render Stats (microseconds):\n" + `|${"id".substring(0, "id".length > 20 ? 20 : "id".length).padEnd(20, " ")}|${"Mounts".substring(0, "Mounts".length > 8 ? 8 : "Mounts".length).padEnd(8, " ")}|${"Mount Mean".substring(0, "Mount Mean".length > 20 ? 20 : "Mount Mean".length).padEnd(20, " ")}|${"Updates".substring(0, "Updates".length > 8 ? 8 : "Updates".length).padEnd(8, " ")}|${"Update Mean".substring(0, "Update Mean".length > 20 ? 20 : "Update Mean".length).padEnd(20, " ")}|${"Nested".substring(0, "Nested".length > 8 ? 8 : "Nested".length).padEnd(8, " ")}|${"Nested Mean".substring(0, "Nested Mean".length > 20 ? 20 : "Nested Mean".length).padEnd(20, " ")}|
` + Object.entries(c6929_3).map((item) => {
const [r43, r44] = item;
const r15 = r43.substring(0, r43.length > 20 ? 20 : r43.length).padEnd(20, " ");
const r56 = r44.mount.count.toString();
const r14 = r56.substring(0, r56.length > 8 ? 8 : r56.length).padEnd(8, " ");
const r66 = r44.mount.mean.toString();
const r13 = r66.substring(0, r66.length > 20 ? 20 : r66.length).padEnd(20, " ");
const r76 = r44.update.count.toString();
const r12 = r76.substring(0, r76.length > 8 ? 8 : r76.length).padEnd(8, " ");
const r86 = r44.update.mean.toString();
const r11 = r86.substring(0, r86.length > 20 ? 20 : r86.length).padEnd(20, " ");
const r96 = r44.nestedUpdate.count.toString();
const r103 = r96.substring(0, r96.length > 8 ? 8 : r96.length).padEnd(8, " ");
const r107 = r44.nestedUpdate.mean.toString();
return `|${r15}|${r14}|${r13}|${r12}|${r11}|${r103}|${r107.substring(0, r107.length > 20 ? 20 : r107.length).padEnd(20, " ")}|
`;
}) : "";
return r34;
}
export function resetComponentProfiler() {
c6929_3 = {};
}
export function pauseComponentProfiler() {
c6929_4 = false;
}
export function resumeComponentProfiler() {
c6929_4 = true;
}
export function dumpStats() {
return c6929_3;
}