PIXI.Application ticker versus manual ticker: which isolates rendering overhead more accurately for bottleneck measurement?
0 reputation · 30 Nov 2021, 00:47 UTC
0 reputation · 30 Nov 2021, 00:47 UTC
The objective is to identify which ticker method—PIXI.Application’s built‑in ticker or a manually controlled ticker—provides a clearer picture of rendering overhead when profiling a PixiJS scene.
PIXI.Application runs a ticker on every animation frame, potentially mixing JavaScript logic with GPU work, while a manual ticker can be paused or throttled, allowing isolation of per‑frame GPU cost; additionally, the default antialias setting in WebGLRenderer may introduce extra draw calls that influence measurements.
Which approach yields more accurate and repeatable frame‑time data for bottleneck detection, and does disabling antialias affect the relative performance difference? Does container depth sorting further confound the comparison?
36775 reputation · 30 Nov 2021, 07:49 UTC
A manually controlled ticker isolates rendering overhead more accurately. PIXI.Application’s built-in ticker advances application callbacks and calls render() inside the same requestAnimationFrame frame, so a single frame-time sample mixes JavaScript logic, garbage collection, and GPU command submission. A manual ticker lets you invoke renderer.render() or app.render() on a paused or throttled scene, making the render pass repeatable and separable from game-loop logic.
Likely explanation. The built-in ticker’s higher variance comes from coupling update and render work. Expensive container traversal or object pooling appears inside the same sample as the render call. A manual loop removes that coupling, although performance.now around render() still measures CPU submission time, not GPU completion.
Confirmed behavior, version-dependent. Assuming PixiJS v6 or v7, WebGLRenderer’s antialias defaults to false. Enabling MSAA raises GPU fill-rate and memory cost; it does not multiply draw calls. Container depth sorting with sortableChildren runs on the CPU before rendering and scales with the number of sorted children, so it can confound any ticker comparison if sorting state differs between runs. requestAnimationFrame is display-rate limited and pauses in background tabs, which can distort manual-loop timing unless the loop is instrumented.
Is the suspected bottleneck CPU command submission or GPU completion? If it is GPU completion, render() timing alone is insufficient and you should add GPU timestamps or a renderer profiler; this does not change the ticker recommendation, only the measurement method.
Assumptions and uncertainty. This answer assumes PixiJS v6/v7 behavior. Antialias defaults and ticker method names vary across v5, v6, and v7, so verify them against your installed version before treating defaults as fact.
Use comments to ask for clarification. Post a solution as an answer.
36,775 reputation · 30 Nov 2021, 06:01 UTC
Use a manual ticker only if you need to measure app.render() in isolation. PIXI.Application’s built-in ticker runs update callbacks and render() inside the same requestAnimationFrame tick, so one performance.now() window blends JavaScript logic with GPU submission.
For render-only timing, stop app.ticker, invoke app.render() directly in a controlled loop, and wrap each call with performance.now(). Compare against Chrome DevTools Performance to confirm ticker callback overhead is excluded.
Note: antialias is a WebGL context creation attribute, so toggling it requires recreating the renderer or Application; it changes fragment coverage, not draw-call count. Also, sortableChildren adds CPU sorting before rendering and can break batching, confounding both approaches. Verify PixiJS v6/v7+ defaults against your installed version before comparing.