Skip to content

Performance

foonerd edited this page Sep 26, 2026 · 15 revisions

Performance

Glass was built to be cheap on the player: it paints only the boxes that change, keeps every picture decoded once, maps fonts from disk, and measures the audio on a thread of its own inside the sound path. This page has the numbers, how they were taken, and what to turn when a player is short of processor time.

The benchmark

A Raspberry Pi 5 with a 1280x720 DSI screen, Volumio 4 with the 32 bit userland, music playing from internal storage throughout. Eight meters drawn at random from a pool of 41 heavy ones, turntables and tape decks: one each from Pioneer PLX-500, custom_turnplate and g5_444_rotate, three from g5_710_Turntables, two from g5_711_Tape_Recorder. Each ran ten seconds at a fixed frame rate; after four seconds its processor share (of one of the four cores), resident memory, the board's power rails and the achieved rate were read. PeppyMeter Screensaver, the Python engine Glass replaces, ran the same eight meters through its own launcher at its 30 frames a second.

Glass at five frame rates, the eight meters averaged

Frames a second Processor, one core Achieved Frame, ms Memory, MB Power, W
10 13 percent 9.5 16.0 113 3.48
15 20 percent 15.0 13.0 116 3.47
30 38 percent 29.9 12.7 122 4.00
45 47 percent 44.7 10.3 126 4.24
60 56 percent 59.6 9.3 126 4.39

Power is the board's rails with the display and fan on them; the idle board read 3.37 W. A frame takes less time at higher rates because the caches of turned needles and text are hit more often and the cores stay clocked up.

Glass against the Python engine, at 30 frames a second

Meter Glass Python Glass memory Python memory
Pioneer PLX-500, turntable 41 percent 78 percent 137 MB 1028 MB
VTEBT record player 30 percent 48 percent 104 MB 941 MB
Streamer CD, turning disc 28 percent 76 percent 115 MB 671 MB
Pioneer Gold turntable 38 percent 76 percent 135 MB 900 MB
Thorens turntable 45 percent 84 percent 142 MB 1092 MB
Denon DP400 turntable 38 percent 74 percent 134 MB 1046 MB
Akai 77 tape recorder 42 percent 52 percent 106 MB 1067 MB
Revox B77 tape recorder 44 percent 70 percent 104 MB 1492 MB
Average 38 percent 70 percent 122 MB 1030 MB
xychart-beta
    title "Processor share of one core at 30 frames a second"
    x-axis ["PLX-500", "VTEBT", "Streamer CD", "Pioneer Gold", "Thorens", "Denon DP400", "Akai 77", "Revox B77"]
    y-axis "percent" 0 --> 100
    bar [41, 30, 28, 38, 45, 38, 42, 44]
    bar [78, 48, 76, 76, 84, 74, 52, 70]
Loading

The first bar of each pair is Glass, the second the Python engine. On power the two boards read 4.00 W against 4.49 W, a difference near the reading's noise; the processor share and the memory are the differences that matter, and on a Raspberry Pi 3 or a Zero 2 W they decide whether a theme runs at all.

Needle meters without turning pictures are far cheaper than these: about 4 percent of a core at 30 frames a second on the same board. A spectrum of sixty bars adds about a fifth of a core.

Where the time goes

Stage What it does Share of a frame
Poll Reads the ring and the channel. under 1 percent
Step The scene: needle angles, text offsets, what turned. 1 to 2 percent
Raster Paints the boxes that changed over the base picture. 80 to 90 percent
Show Uploads the changed boxes to the window. 10 to 15 percent

The raster is the frame. Three things keep it small:

  • Only what changed. Every drawn element is a box with a key; a box whose key is the same as last frame's is not painted and not uploaded. A still theme with a slow needle repaints a few thousand pixels a frame of a million on screen.
  • Composed once. The background, the screen picture and the still parts of the face are composed once per meter into a base the frame is painted over.
  • Turning pictures by row spans. A record, a reel, a knob or a needle is turned by row spans of its opaque pixels with a nearest fixed point step, and the result cached by angle for the small pictures. The Python engine kept a full frame per degree of rotation, which is where its memory went.

GLASS_PROFILE in the display's environment prints these stages for every sixty frames; the Logging page has it.

Threads

A frame is painted in row bands across threads when it needs them. The display starts on one thread and adds one, up to one per core, when frames overrun their period, and hands them back when they stop; --threads N fixes the count. On the Pi 5 one thread keeps up with every theme in the pool at 30 frames a second, and four threads paint a frame twice as fast for a third more processor time, so the display stays on one unless it must.

Memory

What Size
The composed base of a 1280x720 meter 3.7 MB
The frame being painted 3.7 MB
A turntable theme's pictures, decoded 30 to 60 MB
The plugin's fonts mapped from disk, resident by the pages touched
Shared libraries, SDL2 and its GL driver about 47 MB, shared with the system

A heavy theme sits at 105 to 140 MB resident on a 32 bit system; a light one nearer 90 MB. The Python engine sat at 700 to 1500 MB for the same themes.

The audio tap

The tap sits in the ALSA chain of every source and passes the stream through byte for byte; the measurement, peaks, RMS and a 2048 point spectrum, runs on a thread of its own and costs about 2 percent of a core at 44.1 kHz stereo, a little more for high rates and DSD. The sound is not touched: the pass-through is proven bit exact for every format in the project's own workflow before a release.

Remote displays

A remote costs the player nothing to draw: the daemon reads the ring and sends one datagram per hop, at most sixty a second, of about a kilobyte, half a megabit a second per remote. The remote draws with the same code and the same cost as the player would.

What to turn

When Turn
A Raspberry Pi 3 or 4 with a turntable or tape theme The frame rate to 20 or 25 on the Settings page.
A large spectrum on any Pi below the 5 The frame rate to 20, or the spectrum's size in the theme.
A Raspberry Pi Zero 2 W Light themes at 15 frames a second; an 800x480 theme rather than a 1280x720 one.
Records and reels look stepped Rotation quality to High in the Rotation section: 15 redraws a second instead of 8.
A theme fine at 30 but the fan runs Rotation quality to Medium or Low; 25 frames a second.
Fanart with fades on a small player A longer change interval, or no transition.

The frame rate is the biggest lever: the processor share of a theme is close to proportional to it between 15 and 60.

Clone this wiki locally