Omniscio

Renderer stall profiler (what the app was doing when it froze)

When the app window freezes for a second or more, Omniscio records what its code was doing: a .cpuprofile you open in Chrome DevTools plus one log line naming the heaviest functions. It watches only while the window struggles, never changes how the app behaves, keeps the newest 25 recordings under a size cap, and says why whenever it could not record instead of staying silent. Desktop main window only; turn it off with AMC_DISABLE_RENDERER_STALL_PROFILER=1.

On this page

What it is

What it answers

"The app just froze for three seconds — what was it actually doing?"

The main window draws the app. When that drawing is slow — a long chat that re-renders itself on every update is the usual cause — you feel it as typing and clicking hanging. The app has always been able to tell you that a redraw was slow. It could not tell you which part of the code was slow, because nothing was recording it.

This does. It watches the main window for its first 20 minutes of each app run, and when a pause lasts a quarter of a second or more it saves a recording of what the code was doing, plus one line summarising the heaviest parts. When the 20 minutes run out and no pause ever got that big, it saves what it collected anyway — so a freeze later in that window can still be named.

Why you would look here

  • The app felt frozen and you want to know why, rather than guess.
  • Someone asked you for evidence about a slow redraw.
  • You want to check the recorder is actually working (it is quiet when the app is calm — see below).

Where to find it

Turning it on and off

It is on by default. Nothing to enable, no setting to find, no restart needed for the default.

To turn it off, set the environment variable AMC_DISABLE_RENDERER_STALL_PROFILER=1 before starting the app. To check whether it is currently running, look for the "stall profiler" row on the performance scorecard, or in the governor list beside it, which names the switch.

Where the files go

Everything lands in the app's own logs folder — the same one that holds renderer-diag.log:

<app data>/logs/renderer-profiles/<timestamp>-<what>.cpuprofile

Only the newest 25 are kept, and there is a total size cap, so this cannot fill a disk.

How it behaves

Reading one

Open the .cpuprofile file in Chrome DevTools → Performance → Load profile. It shows a flame chart of what ran and how long each part took.

The names will look short and strange — something like nr (index-abc123.js:4567) rather than renderTurnGroup. That is normal and not a fault: the app ships with its internal names shortened to keep it small and fast, and that happens to every finished app. What you do get is the exact file, the exact line, and which chunk of the app the code came from — and the chunk alone answers the question this was built for (is this React's own machinery, or is it our code?). If you need the readable name, the build also keeps a map file that turns that line number back into a name.

Reading the log line

Each capture writes one line into renderer-diag.log, tagged [renderer-stall-profile]:

[renderer-stall-profile] trigger=redraw durationMs=3821 samples=920 window=45000ms file=...cpuprofile top: TurnGroup (index-abc.js:4568) 97% | ...
  • trigger — what noticed the stall (redraw, longtask, or freeze).
  • durationMs — how long the pause lasted.
  • samples — how many snapshots the recording holds.
  • window — how long the recorder had been watching when the pause hit.
  • top — the five heaviest things it saw.

Why the recorder says it could not measure something

If a pause happens while the recorder was not watching, you still get a line — it just says so:

[renderer-stall-profile] trigger=longtask durationMs=1500 samples=0 window=0ms unavailable=disarmed-at-trigger top: (profiler dark — not armed when the stall hit)

That is deliberate. A recorder that quietly stops working looks exactly like an app that stopped being slow, and those are very different facts. The reasons you may see are:

unavailable= What it means
kill-switch Somebody turned it off with the environment variable.
self-defeated Starting it took 1,400 ms or more (the window freezes while it starts), so it switched itself off until the app restarts.
no-window There is no main window to watch right now.
debugger-owned-by-devtools You have DevTools open on the app window; close it and it resumes.
attach-failed The window could not be attached to this time.
arm-failed It attached, but sampling would not start.
disarmed-at-trigger The pause landed before the recorder had started watching.
spent-window Its 20-minute watch window closed; it re-arms while the window is minimized or the machine is idle.
spent-capture This pause is recorded; it re-arms while the window is minimized or the machine is idle.
spent-window-lost The window it was watching was replaced; it re-arms while the window is minimized or the machine is idle.
spent-budget It has taken its four starts for this hour (or two for this freeze class); it re-arms when the hour rolls.
capture-failed The recording came back empty.
write-failed The recording could not be saved (usually disk).

What starting it costs, and when it is allowed to start again

Starting a recording is not free. Before it can take its first snapshot, the recorder has to walk every object the window is holding, and the window is frozen while it does. Measured on a real Electron window in November 2026: 3 ms on a window holding 201 MB in a few large arrays, 247 ms on 230 MB of many small objects, 626 ms at 612 MB, and 1.3–1.7 s on the app's own loaded window. What it costs is the number of objects, not the size in megabytes.

So the recorder takes its first start early, while the window is still nearly empty — a few milliseconds — and every start after that is paid only at a moment you cannot feel it:

  • The first start happens before the window first paints. It watches for 20 minutes and takes one recording — the first pause of a quarter of a second or more; if no pause gets that big, whatever it collected when the 20 minutes close.
  • Later recordings are paid only while nobody is watching: the main window is minimized or hidden, or the computer has seen no keyboard or mouse input for 90 seconds. While you are using a visible window, it never starts itself — that is why a recording can never make the app feel slow.
  • The budget is small and per kind of freeze: at most four starts an hour, and at most two recordings of the same freeze class an hour (the class is the component the render tally named for that pause, e.g. AppInboxBadgeReporter). Every line now carries class=<name>, so the next investigation can tell one recurring freeze from a new one.
  • It is never more than one recording behind. Between recordings the perf:status row and the tape say which state it is in — spent-window (the 20 minutes are up), spent-capture (that pause is recorded), spent-window-lost (the window was replaced) or spent-budget (this hour's starts are used up). None of them means broken, and none of them needs a restart any more.
  • A start that takes 1,400 ms or more switches it off until the app restarts. You get one [renderer-stall-profiler] self-defeated startCostMs=<n> line in renderer-diag.log, and the perf:status row reads DARK — profiler off for this run. That applies to every start, the very first one included, so a computer where starting is pathological pays for it once and no more.

That is a deliberate trade: a handful of recordings an hour, in exchange for a recorder that never freezes the window it exists to explain while you are using it.

Taking one recording anyway

On some computers every start costs more than 1,400 ms, so the recorder switches itself off for the whole run — and those are exactly the computers whose freezes most need a recording (measured 2026-10-22: a 2.6 s start on the owner's box, zero recordings). For that case a developer can ask for one recording on purpose:

  • Send POST /diagnostics/renderer-profile/record-once with the full-access CLI key. The window freezes once while the recorder starts (a few seconds on such a box).
  • If the answer says adopted, the recorder was already running: do the slow thing straight away. If it says arming, wait for the [renderer-stall-profiler] one-shot armed line in renderer-diag.log, then do the slow thing — for example, open the big session. The first freeze of 1 second or more within 10 minutes is saved under renderer-profiles/ like any other recording.
  • Then the recorder goes back to how it was. If it had switched itself off it stays off; otherwise it returns to the state it was in before the request — automatic recording never gains a start it has already spent.
  • It refuses when one is already running, when the recorder is busy starting, or when the off switch is set; it answers 503 when the window or its debugger cannot be reached (for example while DevTools is open).

Between recordings: the render tally

Between recordings the row below still answers "what is the window busy redrawing?" while the CPU recorder is idle. It is the instrument that keeps working in the gaps.

The row, render commits, shows it. Each main area of the window (the whole app, the projects list, the sessions list, the panel area) counts how many times it redrew and how long that took, and the row lists them over the last 30 minutes, the heaviest first. AppRoot is the whole window, so it already includes the others. Do not add them up.

When it cannot count, it says why instead of showing zeros: no report from the window yet, switched off (AMC_KD_COMMIT_ATTRIBUTION=0), a packaged build whose React does not time redraws, or a window that stopped reporting. It costs about 26 nanoseconds per redraw plus one small report a minute.

What it does NOT do

  • It never changes how the app behaves. It only watches. If anything about it fails, the app carries on exactly as if it were not there. The one cost it does impose — the short freeze each start causes — is measured, shown on perf:status, and capped (see above).
  • It only watches the main desktop window. The same chat shown on the phone/web view is a different window, drawn by different code, and is deliberately out of scope — a slow phone view is not evidence about the desktop window, so mixing the two would produce confidently wrong answers.
  • It does not work on the main process. That is a separate instrument with its own tape lines ([stall-stack]); this one is only about the app window's own drawing.
  • Perf status — the scorecard this one reports into.
  • Startup trace — the same idea for startup, step by step.
  • Logs and debugging — where the logs live when you need the raw detail.

Last verified 2026-11-04