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.
TypeScript 2d-game-engine3d3d-game-engineandroidcppecsgame-editorgame-enginegamedeviostypescriptwebassemblywebglwebgpuwechat-minigame
fix(bench): the profile goes to a file, because stdout was dropping it at exit
esenginefdda659b5149
diff --git a/bench/residency/heavy.mjs b/bench/residency/heavy.mjsindex 274387994..905eab513 100755--- a/bench/residency/heavy.mjs+++ b/bench/residency/heavy.mjs@@ -19,7 +19,7 @@* node bench/residency/heavy.mjs --props 80 --bodies 400*/import { spawnSync } from 'node:child_process';-import { rmSync, mkdirSync, writeFileSync, cpSync, existsSync } from 'node:fs';+import { rmSync, mkdirSync, writeFileSync, readFileSync, cpSync, existsSync } from 'node:fs';import path from 'node:path';import { fileURLToPath } from 'node:url';import { randomUUID } from 'node:crypto';@@ -254,7 +254,11 @@ function drive(out, name, steps) {const [, kind, as] = match;if (!runs.has(as)) runs.set(as, { frames: null, delivery: null });try {- const body = line.slice(line.indexOf(kind === 'profile' ? '[' : '{', match[0].length - 1));+ const rest = line.slice(match[0].length);+ // A profile arrives as a path, because stdout cannot carry it whole.+ const body = kind === 'profile' && !rest.startsWith('[')+ ? readFileSync(rest.trim(), 'utf8')+ : line.slice(line.indexOf(kind === 'profile' ? '[' : '{', match[0].length - 1));runs.get(as)[kind === 'profile' ? 'frames' : 'delivery'] = JSON.parse(body);} catch { /* partial line */ }}diff --git a/tools/launchers/residency-run.mjs b/tools/launchers/residency-run.mjsindex fe9e90f19..a6579c6af 100644--- a/tools/launchers/residency-run.mjs+++ b/tools/launchers/residency-run.mjs@@ -24,7 +24,7 @@*/import { app, BrowserWindow } from 'electron';import http from 'node:http';-import { readFile } from 'node:fs/promises';+import { readFile, writeFile } from 'node:fs/promises';import { existsSync } from 'node:fs';import path from 'node:path';import { onRendererConsole } from '../lib/rendererConsole.mjs';@@ -303,7 +303,12 @@ async function main() {return out;})()`);const delivery = await exec('window.__estellaCooked.streaming().delivery');- console.log(`profile ${step.as}: ${JSON.stringify(profile)}`);+ // To a FILE; stdout carries the path. `app.exit` below does not drain a+ // pending pipe write, so a profile large enough to matter arrived+ // truncated — and a truncated line parses as no measurement at all.+ const out = `${SCRIPT}.${step.as}.profile.json`;+ await writeFile(out, JSON.stringify(profile));+ console.log(`profile ${step.as}: ${out}`);console.log(`delivery ${step.as}: ${JSON.stringify(delivery)}`);continue;}