Class in reactor_core.js

ReactorProfiler

10 functions in 3 groups · hide internal

Core runtime: data, input and the ReactorEvents feed.

The in-game frame profiler (F10 to start/stop). While recording it times each frame's phases and keeps a detailed record of every frame over frameThreshold ms, plus between-frame stalls over gapThreshold ms (main-thread work outside the game loop: GC, plugin timers, decodes). Stopping writes save/reactor-profile.json and logs a console summary. Costs nothing until first activated.

@namespace
function ReactorProfiler()

Quick Reference

Setup & Creation 1

_install() Install.

Actions 3

toggle() Toggle.
start() Start.
stop() Stop.

Other 6

frameBegin() Frame begin.
phase() Phase.
frameEnd() Frame end.
_wrap() Wraps hot methods so their time accumulates into a named phase while the profiler is active.
context() What the machine and the game were set to while recording: read with the report, so a slow run can be told fr…
dump() Dump.

Setup & Creation

_install

static internal source
ReactorProfiler._install()

Install.

Actions

toggle

static source
ReactorProfiler.toggle()

Toggle.

start

static source
ReactorProfiler.start()

Start.

stop

static source
ReactorProfiler.stop()

Stop.

Other

frameBegin

static source
ReactorProfiler.frameBegin()

Frame begin.

phase

static source
ReactorProfiler.phase(name, ms)

Phase.

frameEnd

static source
ReactorProfiler.frameEnd()

Frame end.

_wrap

static internal source
ReactorProfiler._wrap(proto, method, phaseName)

Wraps hot methods so their time accumulates into a named phase while the profiler is active.

Details

Wraps hot methods so their time accumulates into a named phase while the profiler is active. Installed lazily on first F10, so plugin replacements of these methods are what actually get timed.

context

static source
ReactorProfiler.context(elapsed)

What the machine and the game were set to while recording: read with the report, so a slow run can be told from a slow machine.

dump

static source
ReactorProfiler.dump()

Dump.