Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

chore(editor): finer perf attribution + isolated automation profile

yhh86ad2241fd75
diff --git a/desktop/electron/main.ts b/desktop/electron/main.ts
index bd8015124..2cb8308dd 100644
--- a/desktop/electron/main.ts
+++ b/desktop/electron/main.ts
@@ -112,6 +112,12 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
// public/ > static assets (wasm, sdk, examples) in dev
process.env.APP_ROOT = path.join(__dirname, '..');
+// Automation runs get their own profile dir so a shot never fights the user's
+// live editor instance over the Chromium disk cache / userData locks.
+if (process.env.ESTELLA_SHOT) {
+ app.setPath('userData', path.join(app.getPath('temp'), 'estella-shot-profile'));
+}
+
const VITE_DEV_SERVER_URL = process.env.VITE_DEV_SERVER_URL;
const RENDERER_DIST = path.join(process.env.APP_ROOT, 'dist');
const VITE_PUBLIC = VITE_DEV_SERVER_URL
diff --git a/desktop/src/layout/StatusBar.tsx b/desktop/src/layout/StatusBar.tsx
index 2f32ded68..ea5f62636 100644
--- a/desktop/src/layout/StatusBar.tsx
+++ b/desktop/src/layout/StatusBar.tsx
@@ -6,6 +6,7 @@ import { useEditorStore } from '@/store/editorStore';
import { useSelection } from '@/store/selectionStore';
import { StatsStore } from '@/engine/StatsStore';
import { SubsystemIndicator } from './SubsystemIndicator';
+import { Perf } from '@/components/Perf';
// Bottom status strip — live engine telemetry (real FPS / entity count / cursor
// world position) reads in the mono face. Anchors the Content Drawer.
@@ -32,7 +33,7 @@ export function StatusBar() {
<span className={`sdot${isPlaying ? ' live' : ''}`} />
{isPlaying ? 'Running' : 'Edit Mode'}
</span>
- <SubsystemIndicator />
+ <Perf id="statusbar.mods"><SubsystemIndicator /></Perf>
<span className="sitem">
{selectedIds.size ? `${selectedIds.size} selected` : 'No selection'}
</span>
diff --git a/desktop/src/main.tsx b/desktop/src/main.tsx
index 120a4b823..617578c50 100644
--- a/desktop/src/main.tsx
+++ b/desktop/src/main.tsx
@@ -37,6 +37,7 @@ import { useSelection } from './store/selectionStore';
import { PlayRealm } from './engine/PlayRealm';
import { dockApi } from './layout/dockApi';
import { EditorControlSurface } from './engine/EditorSession';
+import { PerfMonitor } from './engine/PerfMonitor';
import { LogStore } from './store/LogStore';
import { initFsWatch } from './project/fsWatch';
// Register the built-in settings (side effect) and replay persisted ones.
@@ -63,6 +64,7 @@ if (new URLSearchParams(location.search).has('automation')) {
play: () => useEditorStore.getState().togglePlay(),
playState: () => PlayRealm.getSnapshot(),
reveal: (id: string) => dockApi.revealAndExpand(id),
+ togglePerfOverlay: () => PerfMonitor.toggleOverlay(),
surface: EditorControlSurface,
};
}
diff --git a/desktop/src/panels/Viewport.tsx b/desktop/src/panels/Viewport.tsx
index 8dfbe3c0e..5ccf51fe8 100644
--- a/desktop/src/panels/Viewport.tsx
+++ b/desktop/src/panels/Viewport.tsx
@@ -20,6 +20,7 @@ import { SceneStore } from '@/engine/SceneStore';
import { StatsStore } from '@/engine/StatsStore';
import { PerfMonitor } from '@/engine/PerfMonitor';
import { PerfOverlay } from '@/components/PerfOverlay';
+import { Perf } from '@/components/Perf';
import type { ToolMode } from '@/types';
import { resolveActiveTool, type EditorTool, type ToolContext, type PointerInput } from '@/tools';
import { cursorTile } from '@/tools/tileTools';
@@ -893,7 +894,7 @@ export function Viewport() {
)}
<ViewportHud ready={engine.status === 'ready'} selCount={selCount} zoomPct={zoomPct} tool={tool} />
- {perfVisible && <PerfOverlay />}
+ {perfVisible && <Perf id="viewport.perfhud"><PerfOverlay /></Perf>}
{isPlaying && <div className="viewport__playflag">● PLAY</div>}
</div>