perfSessionEndHook top-level property

void Function() perfSessionEndHook
getter/setter pair

Command that closes a measurement session, turning wind's counting back off.

It exists because perfSessionBeginHook turns counting on, and something has to turn it off again. WindParser.parse is the hottest path in the framework and runs on every build of every W-widget, so leaving counting enabled after a session would tax every later frame in the app for numbers nobody asked for. It is the same discipline ext.dusk.perf_end already applies to the debugProfile* flags it restores.

Counters are deliberately NOT zeroed here: perf_end reads them to build its report, and a hook that cleared them would have to run after the read, which is a coupling worth avoiding. The next session's perfSessionBeginHook zeroes them instead.

Defaults to a no-op.

Hosts wire the real thing by writing:

perfSessionEndHook = () {
  WindPerfCounters.enabled = false;
};

Contract: set-once-per-isolate from MagicPerfIntegration.install(). Reset to this no-op default by MagicPerfIntegration.resetForTesting().

Implementation

void Function() perfSessionEndHook = () {};