Quarkus Desktop experiment shows why a fast first paint can mislead
In a 64-window macOS test, SWT used far less system memory than AWT, while direct Apple API calls traded portability for a smaller footprint.
A fast first window did not predict which Java graphics toolkit held up under load in a December 3 Quarkus Desktop experiment. Holly Cummins used GraalVM native executables to build MoleCam, a demo that renders video as a grid of solid-color windows. Each window is its own process. That deliberately unusual design exposed a cost that a single-window test had missed: how much system memory and GPU time the graphics stack consumed as the number of native processes grew.
What the test measured
In the project’s 64-process test on an Apple Silicon Mac with 52 GB of memory, AWT took 4.2 seconds to bring up the windows, compared with 4.4 seconds for SWT. Yet the reported drop in available system memory worked out to 206 MB per process with AWT versus 24 MB with SWT. GPU busy time was 76% with AWT and 1% with SWT. The post attributes much of AWT’s cost in this setup to each process creating its own Metal pipeline. The memory figure is a share of the system-wide drop in available memory, not the Java heap or the process’s resident set size.
Calling Apple APIs directly through Java’s Foreign Function & Memory API brought the windows up in 2.3–3.2 seconds without shadows and used 13–21 MB of system memory per process in the reported runs. That route requires bindings maintained separately for each operating system. It also exposed a different cost: adding window shadows drove reported GPU busy time from 0% to 43–44%, with little change in memory use.
What to measure before choosing a toolkit
The results are a reason to test at the expected window and process count, not a universal toolkit ranking. The 64-window test ran a 20-second video workload at different color-update rates for AWT and the other approaches. The project's headless Linux result favored AWT over SWT, but adding an Openbox window manager reversed the comparison. Windows was not tested. For a desktop team choosing a stack, measure first paint and aggregate startup separately, then track system memory and GPU activity while the intended workload is running on the target operating system.
sources
comments · 0