Skip to content

Performance Rules

Taiizor edited this page Jun 5, 2026 · 2 revisions

Performance Rules

Sucrose can automatically Close, Pause, or Resume your live wallpaper based on what the system is doing — whether the workstation is locked, a fullscreen game is running, the laptop is on battery, CPU/GPU/RAM/network usage is high, and more. These rules are enforced by the background service Backgroundog and configured on the Settings → Performance page. This page explains every rule, its default action, the thresholds that trigger it, and the difference between a Heavy and a Light pause. For the per-setting reference table, see Settings Performance.

Contents

How the performance engine works

The Backgroundog service (Sucrose.Backgroundog.exe) runs a continuous loop while a live wallpaper is active. On each tick it collects system telemetry (CPU, GPU, memory, network, battery, session/lock/screensaver state, fullscreen/focus detection) and then runs one of two checks:

  • Performance.Start() — when the wallpaper is running and not already paused/closed: tests whether any condition should trip (resume → pause/close).
  • Condition.Start() — when already paused/closed: tests whether the triggering condition has cleared so it can resume.

When Backgroundog pauses or closes the engine it also notifies the Launcher tray icon (via a Signal Icon flag) so the tray reflects the paused state.

stateDiagram-v2
    [*] --> Running
    Running --> Paused: Pause rule trips
    Running --> Closed: Close rule trips
    Paused --> Running: condition clears, resume
    Closed --> Running: condition clears, Run.Start
    note right of Running
        Backgroundog evaluates rules each tick, first match wins:
        Lock, Focus, Sleep, Memory, Remote, Battery, Console, Graphic,
        Network, Session, Virtual, Processor, FullScreen, ScreenSaver, BatterySaver
    end note
Loading

Backgroundog auto-exits when there is no live wallpaper (after a few retries), and is started on demand. The master toggle that enables the whole system is Performance Counter (see below).

The three actions: Close / Pause / Resume

Every condition is configured with a PerformanceType value (Sucrose.Shared.Dependency.Enum.PerformanceType):

Action Meaning
Resume Keep the wallpaper running normally (the rule is effectively disabled for that condition).
Pause Pause rendering of the wallpaper while the condition holds.
Close Kill the wallpaper engine for that condition (heaviest savings; the engine fully exits).

A Close rule calls Live.Helper.Kill.Stop(); a Pause rule pauses (or suspends, see below) the live process. When the condition clears, a Close rule restarts the wallpaper and a Pause rule resumes it.

Heavy vs Light pause

The Pause performance type setting (PausePerformanceType, default Light) controls how aggressive a Pause is:

Mode Behavior
Light Pauses the wallpaper's rendering only.
Heavy Additionally suspends the process threads of the live engine — including the browser child processes (WebView2 / CefSharp subprocesses whose command line contains "Sucrose") and the Aurora application process. This frees the most CPU but takes slightly longer to resume.

Choose Heavy if you want maximum CPU savings (e.g. on a laptop or while gaming) at the cost of a slightly slower resume; choose Light for the quickest, least disruptive pause.

Every condition and its default

Each row below is a separate ComboBox on the Performance page. All keys are stored in Backgroundog.json. Conditions left at Resume never pause or close the wallpaper.

Condition Key Default action Triggers when…
Lock (workstation locked) LockPerformance Close You lock the workstation (Win+L).
Sleep SleepPerformance Close The system enters sleep.
Console (user switch) ConsolePerformance Close Fast user switching / another session takes the console.
Session (logoff) SessionPerformance Close The session logs off.
Screen Saver ScreenSaverPerformance Pause The screensaver starts.
Processor (CPU) ProcessorPerformance Resume CPU usage exceeds the threshold.
Graphic (GPU) GraphicPerformance Resume GPU usage exceeds the threshold.
Memory (RAM) MemoryPerformance Resume RAM usage exceeds the threshold.
Network NetworkPerformance Resume Network ping/upload/download crosses the threshold.
Battery BatteryPerformance Resume Battery charge drops below the threshold.
Battery Saver BatterySaverPerformance Resume Windows Battery Saver / energy saver is active.
Virtual (VM) VirtualPerformance Resume Running inside a virtual machine.
Remote (RDP) RemotePerformance Resume A remote desktop session is active.
Full Screen FullScreenPerformance Resume A foreground app is maximized/fullscreen (e.g. a game).
Focus FocusPerformance Resume The desktop is not the focused window.

The default behavior, therefore, is: stop the wallpaper when you lock, sleep, switch user, or log off; pause it for the screensaver; and otherwise keep running (the resource/laptop rules are off until you set them).

The full set of conditions is enumerated by CategoryPerformanceType: Not, Lock, Focus, Sleep, Memory, Remote, Battery, Console, Graphic, Network, Session, Virtual, Processor, FullScreen, ScreenSaver, BatterySaver (16 members).

Thresholds

For the resource and network conditions you also set a threshold. All keys live in Backgroundog.json.

Threshold Key Default Range / unit
Processor usage ProcessorUsage 70 0–100 (%)
Graphic usage GraphicUsage 70 0–100 (%)
Memory usage MemoryUsage 80 0–100 (%)
Battery charge BatteryUsage 50 0–100 (%)
Upload value + unit UploadValue / UploadType 800 / Kilobyte value 0–99999999; unit is a Skylark.Enum.StorageType
Download value + unit DownloadValue / DownloadType 10 / Megabyte value 0–99999999
Ping value + host PingValue / PingType 100 / "Bing" ping 0–1000 ms; host chosen from the available host list

You can also pin which adapters are measured: Graphic adapter (GraphicAdapter, default auto/first) and Network adapter (NetworkAdapter, default auto/first).

The network condition type (NetworkPerformanceType) can be Not, Ping, Upload, or Download, so you can trip on round-trip latency or on bandwidth.

The master switch and communication

Setting Key Default Effect
Performance Counter PerformanceCounter true The master monitor. When on, Sucrose starts the Backgroundog service; when off, no performance rules are evaluated and Backgroundog is killed.
Pause performance type PausePerformanceType Light Heavy or Light (see above).
Communication type CommunicationType Transmission Pipe, Signal, or Transmission — how Backgroundog talks to the wallpaper (also used to deliver the Audio/System data to web wallpapers).

If you turn Performance Counter off, you lose the automatic Close/Pause behavior and the live data feed that powers audio-reactive web wallpapers.

Rule evaluation order

Performance.Start() checks rules in this fixed order, and the first one that trips wins:

Lock → Focus → Sleep → Memory → Remote → Battery → Console →
Graphic → Network → Session → Virtual → Processor → FullScreen →
ScreenSaver → BatterySaver

Each rule:

  • Is skipped if its action is Resume.
  • Polls its condition for a number of seconds before tripping. Instant conditions (MaxCount = 0) include Lock, Sleep, Console, Session, ScreenSaver; most others wait ~5 seconds; the resource conditions (Memory/Graphic/Processor/Battery/Network) trip on their thresholds.
  • On trip: records the active category, sets the internal Condition flag, and applies the action (Close kills the engine; Pause/Heavy suspends it).

How resume works

When the wallpaper is paused or closed, Condition.Start() mirrors the logic: it polls the active category until the condition clears, then resumes —

  • A Close rule restarts the wallpaper (Run.Start()).
  • A Pause rule resumes rendering; a Heavy pause resumes the suspended process/threads.

The Launcher tray icon is updated back to its normal state once the wallpaper resumes.

See also

Home

Getting Started

Wallpaper Types

Using Sucrose

Settings Reference

Creating Wallpapers

Engine Reference

Automation & Command Line

Architecture & Internals

Data, Files & Diagnostics

Building & Contributing

Help & Support

Clone this wiki locally