refactor: Use compiled json for schema in production

* Use dynamic import for schema based on environment
  * If production use pre-generated json to avoid loading vega generator -- big memory footprint reduction
  * If not production use vega so schema is always up to date
This commit is contained in:
FoxxMD 2026-01-21 16:24:58 +00:00
parent 65d9026f01
commit 69d76d2d44
22 changed files with 212 additions and 120 deletions

View file

@ -178,3 +178,15 @@ For more refer to the TS documentation for `PlayObject` or [`AmbPlayObject`](htt
* [Source Development and Tutorial](dev-source.md)
* [Client Development and Tutorial](dev-client.md)
## Profiling
Run tsx with inspect args
```
NODE_ENV=production node node_modules/.bin/tsx --inspect --heap-prof src/backend/index.ts
```
Use `chrome://inspect` from a chromium-based browser and attach to the running process, usually `localhost:9229`
From the opened DevTools window use Performance or Memory to profile the running process.