Profiler: real-GPU breakdown by zoom, look and scene, with a baseline (t88 phase 0)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-27 18:31:43 -04:00
co-authored by Claude Opus 5.5
parent 0c0edf46ca
commit 9781aa3ee1
17 changed files with 38797 additions and 57 deletions
+15
View File
@@ -0,0 +1,15 @@
// Browser-only clocks; simulation code stays usable without a browser or a clock.
let PERF_MARKS = false, PERF_FRAME = null;
const perfMarks = {}, perfTimes = {}, perfLast = {};
for (const name of ['drawWorld', 'computeLight', 'simMove', 'heatPass']) {
const original = window[name];
window[name] = function (...args) {
if (!SET.showPerf && !PERF_MARKS) return original.apply(this, args);
const start = performance.now();
const result = original.apply(this, args);
const ms = performance.now() - start;
perfLast[name] = ms;
if (name !== 'computeLight') perfTimes[name] = (perfTimes[name] || 0) * 0.9 + ms * 0.1;
return result;
};
}