Add throwaway PixiJS v8 perf prototype (VTT scene + benchmark)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
node_modules
|
||||
dist
|
||||
.devbox
|
||||
@@ -0,0 +1,103 @@
|
||||
# Pixi v8 VTT perf prototype (THROWAWAY)
|
||||
|
||||
Question: can PixiJS v8 (8.22) render a VTT-sized scene smoothly on modest hardware? Measurement tool, not the product.
|
||||
|
||||
## Run
|
||||
|
||||
All commands through devbox (NixOS, nothing global):
|
||||
|
||||
```sh
|
||||
devbox run -- npm install
|
||||
devbox run -- npm run dev # http://localhost:5173
|
||||
devbox run -- npm run dev -- --host # reachable from LAN
|
||||
devbox run -- npm run build # tsc + vite build
|
||||
```
|
||||
|
||||
URL params: `?renderer=webgl|webgpu` (force; overlay shows the renderer actually used), `?res=1` (canvas resolution, default min(dpr,2)),
|
||||
`?bench=1` (auto-run benchmark on load), `?benchMs=5000&warmMs=700`.
|
||||
|
||||
Controls (top right): map size, tile size override (auto = GPU max texture), local map image, grid on/off + cell size, token count,
|
||||
chaos, HP churn, culling, tool (move / pen), +200 random strokes, Run benchmark (markdown table in the textarea; copy button).
|
||||
Mouse: wheel = zoom, drag = pan / drag a token, pen tool: LMB draws, RMB/MMB pans. Touch: 1 finger = drag token / pan / draw, 2 fingers = pinch zoom + pan.
|
||||
|
||||
## Test on mobile
|
||||
|
||||
`devbox run -- npm run dev -- --host`, open `http://<LAN-IP>:5173` on the phone/tablet (same network; open the firewall for 5173 on NixOS if needed:
|
||||
`networking.firewall.allowedTCPPorts`). Then use the on-screen overlay and the benchmark button. Not done in this session (no device available).
|
||||
|
||||
## Headless benchmark (what produced the table below)
|
||||
|
||||
`bench.mjs` drives chromium (from devbox) via playwright-core with SwiftShader (software GL):
|
||||
|
||||
```sh
|
||||
devbox run -- npm run build && devbox run -- npx vite preview --port 4173 &
|
||||
devbox run -- bash -c 'CHROMIUM=$(which chromium) node bench.mjs http://localhost:4173/'
|
||||
```
|
||||
|
||||
## Benchmark (headless Chromium 155, SwiftShader SOFTWARE GL, 1280x720, res 1, WebGL2, maxTex 8192)
|
||||
|
||||
**CAVEAT: this is CPU-emulated GPU. Absolute numbers are NOT representative of any real GPU. Only the relative shape is informative.
|
||||
No real-GPU, WebGPU or mobile numbers were collected; run the in-page button on target hardware and replace this table.**
|
||||
fps is capped at 60 (rAF). `js ms` = JS time per frame measured after Pixi's render call; with software GL the driver blocks inside draw calls so it is inflated at high token counts.
|
||||
Scenario = view fitted to whole map (so small maps show all tokens on screen, large maps show only a fraction), chaos on, grid on, cull on, 5 s each after warmup.
|
||||
|
||||
| map | map path | tokens | strokes | fps | avg ms | p99 ms | worst ms | js ms | frames |
|
||||
|---|---|---|---|---|---|---|---|---|---|
|
||||
| 2048 | single | 50 | 0 | 59.8 | 16.7 | 29.9 | 30.3 | 0.9 | 299 |
|
||||
| 2048 | single | 200 | 0 | 48.4 | 20.6 | 41.2 | 43.1 | 1.7 | 242 |
|
||||
| 2048 | single | 500 | 0 | 31.0 | 32.3 | 36.3 | 38.0 | 4.2 | 154 |
|
||||
| 2048 | single | 1000 | 0 | 20.1 | 49.9 | 54.6 | 54.6 | 7.8 | 100 |
|
||||
| 2048 | single | 2000 | 0 | 11.5 | 86.9 | 94.2 | 94.2 | 85.7 | 59 |
|
||||
| 4096 | single | 50 | 0 | 60.0 | 16.7 | 27.1 | 33.6 | 0.7 | 300 |
|
||||
| 4096 | single | 200 | 0 | 56.5 | 17.7 | 33.3 | 34.5 | 1.7 | 282 |
|
||||
| 4096 | single | 500 | 0 | 43.2 | 23.2 | 49.3 | 51.3 | 3.9 | 216 |
|
||||
| 4096 | single | 1000 | 0 | 30.1 | 33.2 | 38.0 | 39.2 | 7.0 | 150 |
|
||||
| 4096 | single | 2000 | 0 | 18.8 | 53.2 | 58.5 | 58.5 | 52.3 | 96 |
|
||||
| 8192 | single | 50 | 0 | 60.1 | 16.6 | 26.1 | 29.3 | 0.7 | 300 |
|
||||
| 8192 | single | 200 | 0 | 58.4 | 17.1 | 32.9 | 40.8 | 1.7 | 291 |
|
||||
| 8192 | single | 500 | 0 | 48.0 | 20.8 | 40.2 | 41.0 | 3.9 | 240 |
|
||||
| 8192 | single | 1000 | 0 | 36.4 | 27.5 | 33.2 | 39.8 | 7.3 | 182 |
|
||||
| 8192 | single | 2000 | 0 | 23.4 | 42.8 | 48.5 | 49.1 | 42.2 | 118 |
|
||||
| 16384 | 4 tiles | 50 | 0 | 59.7 | 16.8 | 28.0 | 33.0 | 0.7 | 298 |
|
||||
| 16384 | 4 tiles | 200 | 0 | 58.1 | 17.2 | 32.2 | 34.2 | 2.2 | 290 |
|
||||
| 16384 | 4 tiles | 500 | 0 | 48.1 | 20.8 | 38.3 | 40.6 | 4.8 | 240 |
|
||||
| 16384 | 4 tiles | 1000 | 0 | 37.8 | 26.5 | 44.9 | 52.2 | 8.2 | 189 |
|
||||
| 16384 | 4 tiles | 2000 | 0 | 25.4 | 39.3 | 45.4 | 46.0 | 38.7 | 129 |
|
||||
| 4096 | single | 50 | 200 | 38.2 | 26.1 | 49.1 | 49.7 | 0.7 | 191 |
|
||||
| 4096 | single | 500 | 200 | 28.2 | 35.4 | 45.5 | 111.9 | 4.7 | 141 |
|
||||
|
||||
## Techniques used (v8)
|
||||
|
||||
- **Map larger than max texture**: max texture read from the backend (`gl.getParameter(MAX_TEXTURE_SIZE)` / `device.limits.maxTextureDimension2D`);
|
||||
if map > that (or > the "tile size" override) it is sliced into square tiles, each its own canvas -> `Texture.from(canvas)` -> `Sprite` at an integer position.
|
||||
Overlay says SINGLE vs TILED. Here 16384 on a maxTex 8192 device = 2x2 tiles of 8192.
|
||||
- **Culling**: manual `Culler.shared.cull(world, screen, false)` each frame (not the plugin, so it can be toggled); map tiles and stroke sprites are `cullable`
|
||||
with bounds; tokens use a fixed `cullArea` rectangle (no per-frame bounds calc) and `cullableChildren = false`.
|
||||
- **Token labels under HP churn**: `BitmapText` with a pre-installed `BitmapFont` (`BitmapFont.install`), not `Text`: changing `.text` only rebuilds quads, no canvas raster or GPU upload.
|
||||
Circle bodies: one shared `GraphicsContext` per colour (6), tessellated once, reused by all tokens. Tokens are pooled (removed/added, never destroyed).
|
||||
- **Grid**: one `TilingSprite` over a small cell texture (1 quad regardless of map size) rather than thousands of `Graphics` lines.
|
||||
- **Stroke baking**: live stroke = `Graphics` chunks of <=48 points (only the last chunk is re-tessellated per move, older chunks frozen). On pointer up the chunks are rendered once with
|
||||
`renderer.textureGenerator.generateTexture({target, frame, resolution, antialias})` into a `Sprite` and the Graphics are destroyed.
|
||||
Bake resolution follows zoom (1..2), capped so no side exceeds 4096 px.
|
||||
- **Input**: DOM pointer events on the canvas with a hand-rolled pan/zoom/pinch (pixi-viewport 6.0.3 declares `pixi.js >=8` peer, but token drag + pen + pinch needed custom handling anyway).
|
||||
Pixi's federated event features are disabled; token hit test is an O(N) scan on press only.
|
||||
|
||||
## Findings
|
||||
|
||||
Measured (software GL only):
|
||||
- Token count dominates. With a 4096 map at fit zoom: 50 tokens 60 fps, 500 ~43 fps, 2000 ~19 fps. On SwiftShader that is largely fill/raster of BitmapText glyph quads and circle geometry, so it says little about real GPUs.
|
||||
- Map size alone barely matters (2048 vs 16384 comparable at equal on-screen token count); the 2048 rows are *slower* only because all tokens are on screen at once while larger maps cull most of them. So culling works and tiling (2x2) cost no visible fps.
|
||||
- Worst-frame spikes of ~30-50 ms show up at 99th percentile even at 50 tokens (likely software rasteriser/GC; unverified).
|
||||
- **200 baked strokes did cost FPS here** (4096/50 tokens: 60 -> 38 fps; 4096/500: ~43 -> 28 fps). It does not meet the "no noticeable drop" criterion on this renderer. JS time per frame did not change, and a draw-call counter showed only ~4-7 draws/frame with strokes present, so it is not batching/CPU; hiding the stroke layer restored 60 fps.
|
||||
Hypothesis (NOT verified): SwiftShader sampling of 200 distinct, large (e.g. 380x550) un-mipmapped textures minified at zoom 0.16 is slow in software, and a real GPU would not show it. Candidate fixes to try on real hardware if it reproduces: bake into shared atlas / merge strokes into per-region tiles, mipmaps on stroke textures, or smaller bake resolution when zoomed out.
|
||||
- Live drawing of a 400-point stroke (checked with scripted mouse, visual only, no timing) rendered and baked to a correctly-aligned sprite.
|
||||
|
||||
Not measured / hypotheses:
|
||||
- Everything on real GPUs, WebGPU (`?renderer=webgpu` untested), mobile/tablet, touch/pinch behaviour, HP churn and the Run-benchmark under churn (benchmark runs churn OFF; toggle is manual).
|
||||
- Chaos at 2000 tokens costs per-frame `position.set` on 2000 containers: hypothesis that it is cheap on CPU; the `js ms` column is inflated by software GL blocking so it can't confirm.
|
||||
|
||||
Worries for a real VTT:
|
||||
- BitmapText atlas is rasterised at one font size: labels go blurry when zoomed in (needs MSDF or a zoom-dependent font), and the installed glyph set is Latin/digits only; non-Latin names need `Text`/HTMLText or a bigger atlas.
|
||||
- 16384 px maps on a device with maxTex 16384 take the single-texture path = ~1 GB of GPU memory; on mobile (maxTex often 4096-8192, small VRAM) tiling is required and memory, not fps, is the limit. Use the tile-size override to force tiling and check memory on a device. Tile seams at fractional zoom were not inspected.
|
||||
- Per-stroke textures: 200 strokes = 200 separate GPU textures (see above); a real session with thousands of strokes needs atlasing/merging and texture GC planning. Very long single strokes are baked at reduced resolution (4096 cap) and will look soft.
|
||||
- Tokens are one Container + 2 children each; 2000 tokens = 6000 scene nodes touched per frame in chaos mode.
|
||||
@@ -0,0 +1,16 @@
|
||||
// Headless benchmark runner: `devbox run -- npm run bench -- "http://localhost:5173/?benchMs=5000&renderer=webgl"`
|
||||
// needs the dev/preview server running. Chromium from devbox ($CHROMIUM or `chromium` on PATH). SOFTWARE GL => not representative.
|
||||
import { chromium } from 'playwright-core';
|
||||
const url = process.argv[2] ?? 'http://localhost:5173/';
|
||||
const b = await chromium.launch({
|
||||
executablePath: process.env.CHROMIUM ?? 'chromium',
|
||||
args: ['--use-angle=swiftshader', '--enable-unsafe-swiftshader', '--ignore-gpu-blocklist', '--enable-unsafe-webgpu', '--no-sandbox'],
|
||||
});
|
||||
const p = await b.newPage({ viewport: { width: 1280, height: 720 } });
|
||||
p.on('console', (m) => console.error('[page]', m.text()));
|
||||
p.on('pageerror', (e) => console.error('[pageerror]', e.message));
|
||||
await p.goto(url);
|
||||
await p.waitForFunction('window.__ready', null, { timeout: 60000 });
|
||||
if (process.env.SHOT) await p.screenshot({ path: process.env.SHOT });
|
||||
console.log(await p.evaluate('window.__app.runBench()'));
|
||||
await b.close();
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.17.2/.schema/devbox.schema.json",
|
||||
"packages": [
|
||||
"nodejs@latest",
|
||||
"chromium@latest"
|
||||
],
|
||||
"shell": {
|
||||
"init_hook": [
|
||||
"echo 'Welcome to devbox!' > /dev/null"
|
||||
],
|
||||
"scripts": {
|
||||
"test": [
|
||||
"echo \"Error: no test specified\" && exit 1"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
{
|
||||
"lockfile_version": "1",
|
||||
"packages": {
|
||||
"chromium@latest": {
|
||||
"last_modified": "2026-10-08T19:21:32Z",
|
||||
"resolved": "github:NixOS/nixpkgs/8edc0c72e3a38faf5434e40d1f19431125fe4b30#chromium",
|
||||
"source": "devbox-search",
|
||||
"version": "155.0.8059.39",
|
||||
"systems": {
|
||||
"aarch64-linux": {
|
||||
"outputs": [
|
||||
{
|
||||
"name": "out",
|
||||
"path": "/nix/store/q56ri55nzhpwzhisgb2r0kilb61k4f5a-chromium-155.0.8059.39",
|
||||
"default": true
|
||||
},
|
||||
{
|
||||
"name": "sandbox",
|
||||
"path": "/nix/store/a1w34yg08mvma03xps5dsy8vw5hrdy9w-chromium-155.0.8059.39-sandbox"
|
||||
}
|
||||
],
|
||||
"store_path": "/nix/store/q56ri55nzhpwzhisgb2r0kilb61k4f5a-chromium-155.0.8059.39"
|
||||
},
|
||||
"x86_64-linux": {
|
||||
"outputs": [
|
||||
{
|
||||
"name": "out",
|
||||
"path": "/nix/store/ky199ji3a5drs6rm3wr5zidamx9dhz56-chromium-155.0.8059.39",
|
||||
"default": true
|
||||
},
|
||||
{
|
||||
"name": "sandbox",
|
||||
"path": "/nix/store/5hpd396v5byrfp1vnw7zmpfscqd3b1zv-chromium-155.0.8059.39-sandbox"
|
||||
}
|
||||
],
|
||||
"store_path": "/nix/store/ky199ji3a5drs6rm3wr5zidamx9dhz56-chromium-155.0.8059.39"
|
||||
}
|
||||
}
|
||||
},
|
||||
"github:NixOS/nixpkgs/nixpkgs-unstable": {
|
||||
"last_modified": "2026-10-20T14:23:57Z",
|
||||
"resolved": "github:NixOS/nixpkgs/5adc50831c259f87faeb09ddf930d43597197473?lastModified=1792506237&narHash=sha256-Q%2F8KLB6jNfpaUN1HAedE%2Fu%2FEt9feE%2FzYSsutBLKrCFk%3D"
|
||||
},
|
||||
"nodejs@latest": {
|
||||
"last_modified": "2026-10-08T19:21:32Z",
|
||||
"plugin_version": "0.0.2",
|
||||
"resolved": "github:NixOS/nixpkgs/8edc0c72e3a38faf5434e40d1f19431125fe4b30#nodejs_26",
|
||||
"source": "devbox-search",
|
||||
"version": "26.11.1",
|
||||
"systems": {
|
||||
"aarch64-darwin": {
|
||||
"outputs": [
|
||||
{
|
||||
"name": "out",
|
||||
"path": "/nix/store/42hvw959dvc16w7p79xns4p4sgfx2wiv-nodejs-26.11.1",
|
||||
"default": true
|
||||
}
|
||||
],
|
||||
"store_path": "/nix/store/42hvw959dvc16w7p79xns4p4sgfx2wiv-nodejs-26.11.1"
|
||||
},
|
||||
"aarch64-linux": {
|
||||
"outputs": [
|
||||
{
|
||||
"name": "out",
|
||||
"path": "/nix/store/zzx8zal1hmjkamrp8y9k6mjim08pzwz8-nodejs-26.11.1",
|
||||
"default": true
|
||||
}
|
||||
],
|
||||
"store_path": "/nix/store/zzx8zal1hmjkamrp8y9k6mjim08pzwz8-nodejs-26.11.1"
|
||||
},
|
||||
"x86_64-linux": {
|
||||
"outputs": [
|
||||
{
|
||||
"name": "out",
|
||||
"path": "/nix/store/m7vfpzl1rjwjpwlcsqs166jn3lywzpq1-nodejs-26.11.1",
|
||||
"default": true
|
||||
}
|
||||
],
|
||||
"store_path": "/nix/store/m7vfpzl1rjwjpwlcsqs166jn3lywzpq1-nodejs-26.11.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
|
||||
<title>Pixi v8 VTT perf prototype (throwaway)</title>
|
||||
<style>
|
||||
html, body { margin: 0; height: 100%; overflow: hidden; background: #111; font: 12px monospace; color: #eee; }
|
||||
canvas { display: block; touch-action: none; }
|
||||
.panel { position: fixed; background: rgba(0,0,0,.75); padding: 6px 8px; border-radius: 4px; }
|
||||
#stats { top: 4px; left: 4px; white-space: pre; pointer-events: none; }
|
||||
#ctl { top: 4px; right: 4px; max-width: 280px; display: flex; flex-direction: column; gap: 4px; max-height: 96vh; overflow: auto; }
|
||||
#ctl label { display: flex; justify-content: space-between; gap: 6px; align-items: center; }
|
||||
#out { width: 100%; height: 120px; font: 10px monospace; }
|
||||
button, select, input { font: inherit; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="stats" class="panel"></div>
|
||||
<div id="ctl" class="panel"></div>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
Generated
+1323
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "prototype-pixi-perf",
|
||||
"version": "1.0.0",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "tsc && vite build",
|
||||
"bench": "node bench.mjs"
|
||||
},
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"pixi.js": "^8.22.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"playwright-core": "^1.64.1",
|
||||
"typescript": "^7.0.2",
|
||||
"vite": "^8.3.5"
|
||||
},
|
||||
"private": true
|
||||
}
|
||||
@@ -0,0 +1,464 @@
|
||||
// THROWAWAY perf prototype. Pixi v8. See ../README.md.
|
||||
import {
|
||||
Application, BitmapFont, BitmapText, Container, Culler, Graphics, GraphicsContext,
|
||||
Rectangle, Sprite, Texture, TilingSprite, UPDATE_PRIORITY,
|
||||
} from 'pixi.js';
|
||||
|
||||
// ---------- state ----------
|
||||
const S = {
|
||||
map: 4096, tile: 0 /* 0 = auto (maxTex) */, n: 200, cell: 64,
|
||||
grid: true, chaos: false, churn: false, cull: true, tool: 'move' as 'move' | 'pen',
|
||||
};
|
||||
const q = new URLSearchParams(location.search);
|
||||
const BENCH_MS = Number(q.get('benchMs') ?? 5000);
|
||||
const WARM_MS = Number(q.get('warmMs') ?? 700);
|
||||
const TOKEN_R = 24;
|
||||
const TOKEN_MAX = 2000;
|
||||
let customBitmap: ImageBitmap | null = null;
|
||||
let mapInfo = '';
|
||||
let mapBuildMs = 0;
|
||||
let maxTex = 0;
|
||||
let benchStatus = '';
|
||||
|
||||
// ---------- app ----------
|
||||
const app = new Application();
|
||||
const pref = q.get('renderer'); // webgl | webgpu
|
||||
await app.init({
|
||||
resizeTo: window,
|
||||
background: 0x1a1a1a,
|
||||
antialias: false,
|
||||
resolution: Number(q.get('res') ?? Math.min(devicePixelRatio, 2)),
|
||||
autoDensity: true,
|
||||
preference: pref === 'webgl' || pref === 'webgpu' ? pref : undefined,
|
||||
// DOM pointer events are used instead of Pixi's federated events (see README): no hit-testing per move.
|
||||
eventFeatures: { move: false, globalMove: false, click: false, wheel: false },
|
||||
});
|
||||
document.body.prepend(app.canvas);
|
||||
const rendererName = app.renderer.name;
|
||||
{
|
||||
const r = app.renderer as any;
|
||||
maxTex = rendererName === 'webgpu'
|
||||
? r.gpu.device.limits.maxTextureDimension2D
|
||||
: r.gl.getParameter(WebGL2RenderingContext.MAX_TEXTURE_SIZE);
|
||||
}
|
||||
let gpuName = '?';
|
||||
try {
|
||||
const gl = (app.renderer as any).gl as WebGL2RenderingContext | undefined;
|
||||
const ext = gl?.getExtension('WEBGL_debug_renderer_info');
|
||||
if (gl && ext) gpuName = gl.getParameter(ext.UNMASKED_RENDERER_WEBGL);
|
||||
} catch { /* ignore */ }
|
||||
|
||||
const world = new Container();
|
||||
const mapLayer = new Container();
|
||||
const strokeLayer = new Container();
|
||||
const liveLayer = new Container();
|
||||
const tokenLayer = new Container();
|
||||
world.addChild(mapLayer, strokeLayer, tokenLayer, liveLayer);
|
||||
app.stage.addChild(world);
|
||||
|
||||
let grid: TilingSprite | null = null;
|
||||
|
||||
// ---------- map (tiling over max texture size) ----------
|
||||
function hash(x: number, y: number) {
|
||||
let h = (x * 374761393 + y * 668265263) | 0;
|
||||
h = (h ^ (h >>> 13)) * 1274126177;
|
||||
return ((h ^ (h >>> 16)) >>> 0) / 4294967296;
|
||||
}
|
||||
function drawProc(ctx: CanvasRenderingContext2D, ox: number, oy: number, w: number, h: number) {
|
||||
const C = 128; // world-space cell, deterministic so tiles line up
|
||||
for (let cy = Math.floor(oy / C); cy * C < oy + h; cy++) {
|
||||
for (let cx = Math.floor(ox / C); cx * C < ox + w; cx++) {
|
||||
const r = hash(cx, cy);
|
||||
ctx.fillStyle = `hsl(${90 + r * 60}, ${25 + r * 25}%, ${22 + hash(cy, cx) * 18}%)`;
|
||||
ctx.fillRect(cx * C - ox, cy * C - oy, C, C);
|
||||
if (r > 0.7) {
|
||||
ctx.fillStyle = 'rgba(40,90,160,.6)';
|
||||
ctx.beginPath();
|
||||
ctx.arc(cx * C - ox + C / 2, cy * C - oy + C / 2, 20 + r * 40, 0, 7);
|
||||
ctx.fill();
|
||||
}
|
||||
}
|
||||
}
|
||||
ctx.strokeStyle = 'rgba(0,0,0,.5)';
|
||||
ctx.lineWidth = 3;
|
||||
for (let x = Math.ceil(ox / 1024) * 1024; x < ox + w; x += 1024) { ctx.beginPath(); ctx.moveTo(x - ox, 0); ctx.lineTo(x - ox, h); ctx.stroke(); }
|
||||
for (let y = Math.ceil(oy / 1024) * 1024; y < oy + h; y += 1024) { ctx.beginPath(); ctx.moveTo(0, y - oy); ctx.lineTo(w, y - oy); ctx.stroke(); }
|
||||
}
|
||||
function buildMap() {
|
||||
const t0 = performance.now();
|
||||
for (const c of mapLayer.removeChildren()) (c as Sprite).destroy({ texture: true, textureSource: true });
|
||||
const size = S.map;
|
||||
const tile = Math.min(size, S.tile || maxTex, maxTex);
|
||||
const nt = Math.ceil(size / tile);
|
||||
try {
|
||||
for (let ty = 0; ty < nt; ty++) {
|
||||
for (let tx = 0; tx < nt; tx++) {
|
||||
const ox = tx * tile, oy = ty * tile;
|
||||
const w = Math.min(tile, size - ox), h = Math.min(tile, size - oy);
|
||||
const cv = document.createElement('canvas');
|
||||
cv.width = w; cv.height = h;
|
||||
const ctx = cv.getContext('2d')!;
|
||||
if (customBitmap) {
|
||||
const k = customBitmap.width / size, kh = customBitmap.height / size;
|
||||
ctx.drawImage(customBitmap, ox * k, oy * kh, w * k, h * kh, 0, 0, w, h);
|
||||
} else drawProc(ctx, ox, oy, w, h);
|
||||
const spr = new Sprite(Texture.from(cv));
|
||||
spr.position.set(ox, oy);
|
||||
spr.cullable = true; // culled by the Culler each frame (tiles outside view are skipped)
|
||||
mapLayer.addChild(spr);
|
||||
}
|
||||
}
|
||||
mapInfo = nt === 1
|
||||
? `${size}px: SINGLE texture (maxTex ${maxTex})`
|
||||
: `${size}px: TILED ${nt}x${nt} of ${tile}px (maxTex ${maxTex})`;
|
||||
} catch (e) {
|
||||
mapInfo = `${size}px: BUILD FAILED ${e}`;
|
||||
}
|
||||
if (grid) { grid.width = grid.height = size; }
|
||||
mapBuildMs = performance.now() - t0;
|
||||
}
|
||||
|
||||
// ---------- grid (one TilingSprite, 1 quad) ----------
|
||||
function buildGrid() {
|
||||
const c = S.cell;
|
||||
const cv = document.createElement('canvas');
|
||||
cv.width = cv.height = c;
|
||||
const ctx = cv.getContext('2d')!;
|
||||
ctx.strokeStyle = 'rgba(255,255,255,.35)';
|
||||
ctx.lineWidth = 2;
|
||||
ctx.strokeRect(0, 0, c, c);
|
||||
const tex = Texture.from(cv);
|
||||
if (!grid) { grid = new TilingSprite({ texture: tex, width: S.map, height: S.map }); mapLayer.parent!.addChildAt(grid, 1); }
|
||||
else { const old = grid.texture; grid.texture = tex; old.destroy(true); }
|
||||
grid.width = grid.height = S.map;
|
||||
grid.visible = S.grid;
|
||||
}
|
||||
|
||||
// ---------- tokens ----------
|
||||
BitmapFont.install({
|
||||
name: 'tok',
|
||||
style: { fontFamily: 'Arial', fontSize: 16, fill: 0xffffff, stroke: { color: 0x000000, width: 3 } },
|
||||
chars: [['a', 'z'], ['A', 'Z'], ['0', '9'], ' /-'],
|
||||
});
|
||||
// one shared GraphicsContext per colour: tessellated once, reused by every token
|
||||
const bodyCtx = [0xc0392b, 0x2980b9, 0x27ae60, 0x8e44ad, 0xd35400, 0x16a085].map(
|
||||
(c) => new GraphicsContext().circle(0, 0, TOKEN_R).fill(c).stroke({ width: 3, color: 0xffffff }),
|
||||
);
|
||||
type Tok = { c: Container; label: BitmapText; x: number; y: number; vx: number; vy: number; hp: number; name: string };
|
||||
const toks: Tok[] = [];
|
||||
const label = (t: Tok) => `${t.name} ${t.hp}/99`;
|
||||
function makeTok(i: number): Tok {
|
||||
const c = new Container();
|
||||
const body = new Graphics(bodyCtx[i % bodyCtx.length]);
|
||||
const t: Tok = {
|
||||
c, label: null as any, name: 'T' + i, hp: (hash(i, 7) * 99) | 0,
|
||||
x: hash(i, 1) * S.map, y: hash(i, 2) * S.map,
|
||||
vx: (hash(i, 3) - 0.5) * 400, vy: (hash(i, 4) - 0.5) * 400,
|
||||
};
|
||||
const l = new BitmapText({ text: label(t), style: { fontFamily: 'tok', fontSize: 16 } });
|
||||
l.anchor.set(0.5, 0);
|
||||
l.y = TOKEN_R + 2;
|
||||
t.label = l;
|
||||
c.addChild(body, l);
|
||||
c.cullable = true;
|
||||
c.cullArea = new Rectangle(-45, -TOKEN_R - 2, 90, TOKEN_R * 2 + 28); // fixed cull rect: no per-frame bounds calc
|
||||
c.cullableChildren = false;
|
||||
c.position.set(t.x, t.y);
|
||||
return t;
|
||||
}
|
||||
function setTokens() {
|
||||
while (toks.length < S.n) toks.push(makeTok(toks.length));
|
||||
tokenLayer.removeChildren(); // pooled, never destroyed
|
||||
for (let i = 0; i < S.n; i++) {
|
||||
const t = toks[i];
|
||||
t.x = Math.min(t.x, S.map); t.y = Math.min(t.y, S.map);
|
||||
t.c.position.set(t.x, t.y);
|
||||
tokenLayer.addChild(t.c);
|
||||
}
|
||||
}
|
||||
|
||||
// ---------- strokes: live Graphics chunks -> baked to one Sprite texture ----------
|
||||
const PEN_W = 4;
|
||||
let live: { pts: number[]; start: number; cur: Graphics; color: number } | null = null;
|
||||
function drawChunk(g: Graphics, pts: number[], from: number, color: number) {
|
||||
g.clear().moveTo(pts[from], pts[from + 1]);
|
||||
for (let i = from + 2; i < pts.length; i += 2) g.lineTo(pts[i], pts[i + 1]);
|
||||
if (pts.length - from === 2) g.lineTo(pts[from] + 0.01, pts[from + 1]);
|
||||
g.stroke({ width: PEN_W, color, cap: 'round', join: 'round' });
|
||||
}
|
||||
function startStroke(x: number, y: number) {
|
||||
const color = (Math.random() * 0xffffff) | 0 | 0x303030;
|
||||
const cur = new Graphics();
|
||||
liveLayer.addChild(cur);
|
||||
live = { pts: [x, y], start: 0, cur, color };
|
||||
drawChunk(cur, live.pts, 0, color);
|
||||
}
|
||||
function addPoint(x: number, y: number) {
|
||||
if (!live) return;
|
||||
const L = live;
|
||||
L.pts.push(x, y);
|
||||
// only the last <=48 points get re-tessellated; older chunks stay frozen => O(1) per move
|
||||
if (L.pts.length - L.start > 96) {
|
||||
L.start = L.pts.length - 2;
|
||||
L.cur = new Graphics();
|
||||
liveLayer.addChild(L.cur);
|
||||
}
|
||||
drawChunk(L.cur, L.pts, L.start, L.color);
|
||||
}
|
||||
function bake(target: Container) {
|
||||
const b = target.getLocalBounds().rectangle;
|
||||
const pad = PEN_W;
|
||||
const frame = new Rectangle(Math.floor(b.x - pad), Math.floor(b.y - pad), Math.ceil(b.width + 2 * pad), Math.ceil(b.height + 2 * pad));
|
||||
// resolution follows zoom (sharp when zoomed in) but caps the texture at 4096px per side
|
||||
const res = Math.min(Math.max(1, Math.min(2, world.scale.x)), 4096 / Math.max(frame.width, frame.height));
|
||||
const texture = app.renderer.textureGenerator.generateTexture({ target, frame, resolution: res, antialias: true });
|
||||
const spr = new Sprite(texture);
|
||||
spr.scale.set(1 / res);
|
||||
spr.position.set(frame.x, frame.y);
|
||||
spr.cullable = true;
|
||||
strokeLayer.addChild(spr);
|
||||
}
|
||||
function endStroke() {
|
||||
if (!live) return;
|
||||
live = null;
|
||||
bake(liveLayer);
|
||||
for (const c of liveLayer.removeChildren()) c.destroy();
|
||||
}
|
||||
function randomStrokes(count: number) {
|
||||
for (let k = 0; k < count; k++) {
|
||||
const g = new Graphics();
|
||||
let x = Math.random() * S.map, y = Math.random() * S.map, a = Math.random() * 6.28;
|
||||
const pts = [x, y];
|
||||
for (let i = 0; i < 60; i++) { a += (Math.random() - 0.5) * 0.9; x += Math.cos(a) * 14; y += Math.sin(a) * 14; pts.push(x, y); }
|
||||
drawChunk(g, pts, 0, (Math.random() * 0xffffff) | 0 | 0x303030);
|
||||
bake(g);
|
||||
g.destroy();
|
||||
}
|
||||
}
|
||||
function clearStrokes() {
|
||||
for (const c of strokeLayer.removeChildren()) (c as Sprite).destroy({ texture: true, textureSource: true });
|
||||
}
|
||||
|
||||
// ---------- pan / zoom / drag / draw (DOM pointer events) ----------
|
||||
function zoomAt(px: number, py: number, k: number) {
|
||||
const s0 = world.scale.x, s1 = Math.min(8, Math.max(0.02, s0 * k));
|
||||
world.position.set(px - (px - world.x) * (s1 / s0), py - (py - world.y) * (s1 / s0));
|
||||
world.scale.set(s1);
|
||||
}
|
||||
function fit() {
|
||||
const s = (Math.min(innerWidth, innerHeight) / S.map) * 0.9;
|
||||
world.scale.set(s);
|
||||
world.position.set((innerWidth - S.map * s) / 2, (innerHeight - S.map * s) / 2);
|
||||
}
|
||||
const cv = app.canvas;
|
||||
cv.addEventListener('contextmenu', (e) => e.preventDefault());
|
||||
cv.addEventListener('wheel', (e) => { e.preventDefault(); zoomAt(e.offsetX, e.offsetY, Math.exp(-e.deltaY * 0.0015)); }, { passive: false });
|
||||
const ptrs = new Map<number, { x: number; y: number }>();
|
||||
let mode: 'none' | 'pan' | 'drag' | 'draw' | 'pinch' = 'none';
|
||||
let dragTok: Tok | null = null;
|
||||
let pinch = { d: 1, cx: 0, cy: 0 };
|
||||
const toWorld = (x: number, y: number) => [(x - world.x) / world.scale.x, (y - world.y) / world.scale.x];
|
||||
function pinchState() {
|
||||
const [a, b] = [...ptrs.values()];
|
||||
return { d: Math.hypot(a.x - b.x, a.y - b.y) || 1, cx: (a.x + b.x) / 2, cy: (a.y + b.y) / 2 };
|
||||
}
|
||||
cv.addEventListener('pointerdown', (e) => {
|
||||
cv.setPointerCapture(e.pointerId);
|
||||
ptrs.set(e.pointerId, { x: e.offsetX, y: e.offsetY });
|
||||
if (ptrs.size >= 2) { endStroke(); dragTok = null; mode = 'pinch'; pinch = pinchState(); return; }
|
||||
if (S.tool === 'pen' && e.button === 0) { mode = 'draw'; startStroke(...(toWorld(e.offsetX, e.offsetY) as [number, number])); return; }
|
||||
const [wx, wy] = toWorld(e.offsetX, e.offsetY);
|
||||
dragTok = null;
|
||||
if (e.button === 0) {
|
||||
for (let i = S.n - 1; i >= 0; i--) { // O(N) only on press, not per move
|
||||
const t = toks[i];
|
||||
if ((t.x - wx) ** 2 + (t.y - wy) ** 2 < TOKEN_R * TOKEN_R) { dragTok = t; break; }
|
||||
}
|
||||
}
|
||||
mode = dragTok ? 'drag' : 'pan';
|
||||
});
|
||||
cv.addEventListener('pointermove', (e) => {
|
||||
const p = ptrs.get(e.pointerId);
|
||||
if (!p) return;
|
||||
const dx = e.offsetX - p.x, dy = e.offsetY - p.y;
|
||||
p.x = e.offsetX; p.y = e.offsetY;
|
||||
if (mode === 'pan') world.position.set(world.x + dx, world.y + dy);
|
||||
else if (mode === 'drag' && dragTok) {
|
||||
dragTok.x += dx / world.scale.x; dragTok.y += dy / world.scale.x;
|
||||
dragTok.c.position.set(dragTok.x, dragTok.y);
|
||||
} else if (mode === 'draw') {
|
||||
const rect = cv.getBoundingClientRect();
|
||||
for (const ce of e.getCoalescedEvents?.() ?? [e]) {
|
||||
const [wx, wy] = toWorld(ce.clientX - rect.left, ce.clientY - rect.top);
|
||||
addPoint(wx, wy);
|
||||
}
|
||||
} else if (mode === 'pinch' && ptrs.size >= 2) {
|
||||
const n = pinchState();
|
||||
world.position.set(world.x + (n.cx - pinch.cx), world.y + (n.cy - pinch.cy));
|
||||
zoomAt(n.cx, n.cy, n.d / pinch.d);
|
||||
pinch = n;
|
||||
}
|
||||
});
|
||||
function up(e: PointerEvent) {
|
||||
if (!ptrs.delete(e.pointerId)) return;
|
||||
if (mode === 'draw') endStroke();
|
||||
dragTok = null;
|
||||
mode = ptrs.size === 1 && mode === 'pinch' ? 'pan' : 'none';
|
||||
}
|
||||
cv.addEventListener('pointerup', up);
|
||||
cv.addEventListener('pointercancel', up);
|
||||
|
||||
// ---------- per-frame loop + frame stats ----------
|
||||
type Sample = { t: number; dt: number; cpu: number };
|
||||
let samples: Sample[] = [];
|
||||
let lastT = performance.now();
|
||||
let frameStart = 0;
|
||||
let benchSink: Sample[] | null = null;
|
||||
function setCull(on: boolean) {
|
||||
if (!on) for (const l of [mapLayer, strokeLayer, tokenLayer]) for (const c of l.children) c.renderable = true;
|
||||
}
|
||||
app.ticker.add(() => {
|
||||
const now = performance.now();
|
||||
frameStart = now;
|
||||
const dt = now - lastT;
|
||||
lastT = now;
|
||||
samples.push({ t: now, dt, cpu: 0 });
|
||||
while (samples[0].t < now - 2000) samples.shift();
|
||||
const sec = Math.min(dt, 100) / 1000;
|
||||
if (S.chaos) {
|
||||
for (let i = 0; i < S.n; i++) {
|
||||
const t = toks[i];
|
||||
t.x += t.vx * sec; t.y += t.vy * sec;
|
||||
if (t.x < 0 || t.x > S.map) t.vx = -t.vx;
|
||||
if (t.y < 0 || t.y > S.map) t.vy = -t.vy;
|
||||
t.c.position.set(t.x, t.y);
|
||||
}
|
||||
}
|
||||
if (S.churn) {
|
||||
for (let i = 0; i < S.n; i++) { const t = toks[i]; t.hp = (t.hp + 1 + ((Math.random() * 7) | 0)) % 100; t.label.text = label(t); }
|
||||
}
|
||||
if (S.cull) Culler.shared.cull(world, app.screen, false);
|
||||
}, undefined, UPDATE_PRIORITY.HIGH);
|
||||
// runs after Pixi's render (LOW) => JS time spent per frame incl. render submission (not GPU time)
|
||||
app.ticker.add(() => {
|
||||
const s = samples[samples.length - 1];
|
||||
s.cpu = performance.now() - frameStart;
|
||||
benchSink?.push(s);
|
||||
}, undefined, UPDATE_PRIORITY.UTILITY);
|
||||
|
||||
function stats() {
|
||||
const n = samples.length || 1;
|
||||
const avg = samples.reduce((a, s) => a + s.dt, 0) / n;
|
||||
const worst = samples.reduce((a, s) => Math.max(a, s.dt), 0);
|
||||
const cpu = samples.reduce((a, s) => a + s.cpu, 0) / n;
|
||||
return { avg, worst, cpu, fps: 1000 / avg };
|
||||
}
|
||||
const stat = document.getElementById('stats')!;
|
||||
setInterval(() => {
|
||||
const s = stats();
|
||||
stat.textContent =
|
||||
`FPS ${s.fps.toFixed(1)} frame avg ${s.avg.toFixed(1)}ms worst(2s) ${s.worst.toFixed(1)}ms js ${s.cpu.toFixed(1)}ms\n` +
|
||||
`renderer: ${rendererName}${pref ? ` (forced ${pref})` : ''} res ${app.renderer.resolution} maxTex ${maxTex}\n` +
|
||||
`map: ${mapInfo} (built ${mapBuildMs.toFixed(0)}ms${customBitmap ? ', custom image' : ', procedural'})\n` +
|
||||
`tokens ${S.n} strokes ${strokeLayer.children.length} grid ${S.grid ? S.cell + 'px' : 'off'} chaos ${S.chaos} churn ${S.churn} cull ${S.cull} tool ${S.tool}\n` +
|
||||
`zoom ${world.scale.x.toFixed(2)}${benchStatus ? '\n' + benchStatus : ''}`;
|
||||
}, 250);
|
||||
|
||||
// ---------- benchmark ----------
|
||||
const sleep = (ms: number) => new Promise((r) => setTimeout(r, ms));
|
||||
const nextFrames = (n: number) => new Promise<void>((r) => { let k = 0; const f = () => { if (++k >= n) { app.ticker.remove(f); r(); } }; app.ticker.add(f); });
|
||||
async function runBench(out: HTMLTextAreaElement) {
|
||||
const maps = [2048, 4096, 8192, 16384], counts = [50, 200, 500, 1000, 2000];
|
||||
const sc: { map: number; n: number; strokes: number }[] = [];
|
||||
for (const m of maps) for (const n of counts) sc.push({ map: m, n, strokes: 0 });
|
||||
sc.push({ map: 4096, n: 50, strokes: 200 }, { map: 4096, n: 500, strokes: 200 });
|
||||
const saved = { ...S };
|
||||
S.chaos = true; S.churn = false; S.cull = true; S.grid = true;
|
||||
const rows: string[] = [];
|
||||
let strokes = strokeLayer.children.length;
|
||||
for (let i = 0; i < sc.length; i++) {
|
||||
const c = sc[i];
|
||||
benchStatus = `BENCH ${i + 1}/${sc.length}: map ${c.map} tokens ${c.n} strokes ${c.strokes}`;
|
||||
if (S.map !== c.map) { S.map = c.map; buildMap(); fit(); }
|
||||
if (strokes !== c.strokes) { clearStrokes(); randomStrokes(c.strokes); strokes = c.strokes; }
|
||||
S.n = c.n; setTokens();
|
||||
const path = mapLayer.children.length === 1 ? 'single' : `${mapLayer.children.length} tiles`;
|
||||
await sleep(WARM_MS);
|
||||
await nextFrames(3); // first frames include GPU texture upload; never measure them
|
||||
const sink: Sample[] = [];
|
||||
benchSink = sink;
|
||||
await sleep(BENCH_MS);
|
||||
benchSink = null;
|
||||
console.log(`scenario ${i}`, c.map, c.n, c.strokes, path, mapInfo, 'frames', sink.length);
|
||||
if (!sink.length) await nextFrames(2); // unreachable in practice
|
||||
const dts = sink.length ? sink.map((s) => s.dt) : [NaN];
|
||||
const avg = dts.reduce((a, b) => a + b, 0) / dts.length;
|
||||
const sorted = [...dts].sort((a, b) => a - b);
|
||||
const p99 = sorted[Math.floor(sorted.length * 0.99)];
|
||||
const cpu = sink.reduce((a, s) => a + s.cpu, 0) / sink.length;
|
||||
rows.push(`| ${c.map} | ${path} | ${c.n} | ${c.strokes} | ${(1000 / avg).toFixed(1)} | ${avg.toFixed(1)} | ${p99.toFixed(1)} | ${Math.max(...dts).toFixed(1)} | ${cpu.toFixed(1)} | ${dts.length} |`);
|
||||
}
|
||||
Object.assign(S, saved);
|
||||
buildMap(); setTokens(); clearStrokes(); buildGrid(); fit(); refreshUI();
|
||||
benchStatus = '';
|
||||
const md =
|
||||
`Renderer: ${rendererName}, GPU: ${gpuName}, maxTex ${maxTex}, res ${app.renderer.resolution}, viewport ${innerWidth}x${innerHeight}, ${BENCH_MS}ms/scenario (+${WARM_MS}ms warmup), chaos on, grid on, cull on\n` +
|
||||
`UA: ${navigator.userAgent}\n\n` +
|
||||
`| map | map path | tokens | strokes | fps | avg ms | p99 ms | worst ms | js ms | frames |\n|---|---|---|---|---|---|---|---|---|---|\n` +
|
||||
rows.join('\n');
|
||||
out.value = md;
|
||||
(window as any).__bench = md;
|
||||
return md;
|
||||
}
|
||||
|
||||
// ---------- controls ----------
|
||||
const ctl = document.getElementById('ctl')!;
|
||||
const refreshers: (() => void)[] = [];
|
||||
const refreshUI = () => refreshers.forEach((f) => f());
|
||||
function select(name: string, opts: (string | number)[], get: () => string | number, set: (v: string) => void) {
|
||||
const l = document.createElement('label'); l.append(name);
|
||||
const s = document.createElement('select');
|
||||
for (const o of opts) s.add(new Option(String(o), String(o)));
|
||||
s.onchange = () => set(s.value);
|
||||
refreshers.push(() => (s.value = String(get())));
|
||||
l.append(s); ctl.append(l); refreshers.at(-1)!();
|
||||
}
|
||||
function check(name: string, get: () => boolean, set: (v: boolean) => void) {
|
||||
const l = document.createElement('label'); l.append(name);
|
||||
const c = document.createElement('input'); c.type = 'checkbox';
|
||||
c.onchange = () => set(c.checked);
|
||||
refreshers.push(() => (c.checked = get()));
|
||||
l.append(c); ctl.append(l); refreshers.at(-1)!();
|
||||
}
|
||||
function button(name: string, fn: () => void) {
|
||||
const b = document.createElement('button'); b.textContent = name; b.onclick = fn; ctl.append(b);
|
||||
}
|
||||
select('map size', [2048, 4096, 8192, 16384], () => S.map, (v) => { S.map = +v; buildMap(); buildGrid(); setTokens(); fit(); });
|
||||
select('tile size', ['auto', 2048, 4096], () => S.tile || 'auto', (v) => { S.tile = v === 'auto' ? 0 : +v; buildMap(); });
|
||||
const file = document.createElement('input'); file.type = 'file'; file.accept = 'image/*';
|
||||
file.onchange = async () => { if (file.files?.[0]) { customBitmap = await createImageBitmap(file.files[0]); buildMap(); } };
|
||||
ctl.append('map image:', file);
|
||||
check('grid', () => S.grid, (v) => { S.grid = v; grid!.visible = v; });
|
||||
select('grid cell px', [16, 32, 50, 64, 100, 128, 256], () => S.cell, (v) => { S.cell = +v; buildGrid(); });
|
||||
select('tokens', [50, 200, 500, 1000, 2000], () => S.n, (v) => { S.n = +v; setTokens(); });
|
||||
check('chaos (move all every frame)', () => S.chaos, (v) => (S.chaos = v));
|
||||
check('HP churn (text every frame)', () => S.churn, (v) => (S.churn = v));
|
||||
check('culling', () => S.cull, (v) => { S.cull = v; setCull(v); });
|
||||
select('tool (RMB/MMB/2 fingers = pan)', ['move', 'pen'], () => S.tool, (v) => (S.tool = v as 'move' | 'pen'));
|
||||
button('+200 random strokes', () => randomStrokes(200));
|
||||
button('clear strokes', clearStrokes);
|
||||
button('fit view', fit);
|
||||
const out = document.createElement('textarea'); out.id = 'out'; out.readOnly = true;
|
||||
button('Run benchmark', () => { void runBench(out); });
|
||||
button('copy results', () => navigator.clipboard?.writeText(out.value));
|
||||
ctl.append(out);
|
||||
|
||||
// ---------- init ----------
|
||||
buildMap();
|
||||
buildGrid();
|
||||
setTokens();
|
||||
fit();
|
||||
refreshUI();
|
||||
(window as any).__ready = true;
|
||||
(window as any).__app = { S, world, strokeLayer, stats, runBench: () => runBench(out), randomStrokes, setTokens, buildMap, buildGrid, fit };
|
||||
if (q.get('bench')) void runBench(out);
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2022",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"lib": ["ES2022", "DOM"],
|
||||
"strict": true,
|
||||
"noEmit": true,
|
||||
"skipLibCheck": true,
|
||||
"types": ["vite/client"]
|
||||
},
|
||||
"include": ["src"]
|
||||
}
|
||||
Reference in New Issue
Block a user