Measuring brute force against jump flooding

This benchmark originally suggested switching to jump flooding near 500 seeds. Its two paths handle offscreen seeds differently, so that number needs another measurement. The results below show what was measured and where the comparison falls short.

A live field from moving seeds, banded by distance with cell boundaries drawn. Left: 24 seeds. Right: 220. Both brute force.

The historical measurement

These September 4, 2026 results came from WebGL2 at 960×540 on an Apple M4 Max. Both paths used RGBA32F render targets. The jump-flood path cleared its initial target, splatted seeds, then ran ten ping-pong passes with nine candidate samples per pixel. The jumps were 512, 256, 128, 64, 32, 16, 8, 4, 2 and 1.

Each sample timed six executions followed by a synchronous readback from the last target, using performance.now(), then divided the elapsed time by six. The reported value was the median of 70 samples after 30 warm-up samples. It includes JavaScript submission, synchronization and readback overhead. It isn't isolated GPU execution time.

SeedsBrute forceJump floodWinner
40.050 ms0.417 msbrute, 8x
160.050 ms0.400 msbrute, 8x
640.083 ms0.400 msbrute, 4.8x
1280.133 ms0.400 msbrute, 3x
2560.217 ms0.400 msbrute, 1.8x
5120.383 ms0.400 mseven
10240.750 ms0.417 msflood, 1.8x
20481.517 ms0.417 msflood, 3.6x

What prevents a crossover claim

The original result suggested a crossover near 500 seeds for these implementations. An audit found that the two paths didn't always evaluate the same seed set. The table is a record of that run, and doesn't establish a reliable crossover.

A corrected comparison needs matching seed positions and distance units, an explicit policy for offscreen and colliding seeds, and output checks against brute force. GPU timer queries can separate GPU execution from CPU and readback costs where the browser supports them. Those changes can move the measured crossover.

What the algorithm does tell us

The demo and the decision

Both panels use brute force. They show the nearest-seed field and Voronoi boundaries at two seed counts; they don't compare the speed or accuracy of jump flooding. A second scan checks every bisector of the nearest seed to find the closest cell edge. Looking only at the second-nearest seed can miss that edge.

Measure the complete implementations on the hardware and resolution they'll use. Check the output as well as the time. This historical test doesn't support a general rule to switch at 500 seeds on desktop or mobile.

Sources

All 61 notes How to use them Credits

If you find anything wrong, let me know at hello@andrewdetwiler.com and I'll get it updated.