Cryptograss:Bacon graphs/Scaling

From PickiPedia: A knowledge base of bluegrass, old time psychedelic jams, and other public domain music
Jump to navigationJump to search

The record of how the connectome's published graph scales, and the one number everyone watches.[unverified]

The deal

Justin, #connectome, 19 Nov 2026 (block 26,446,002): do nothing for now; when the graph file reaches 1 MB on the wire, optimize like crazy.[unverified]

The number is graph.json's size as the browser fetches it: compressed for the wire, not bytes on disk, and 1 MB is 1,000,000 bytes. It's the only data the explorer loads before it draws; the store's connectome.sqlite (6.9 MB) is only a download link. blu takes the reading after every merge that touches the connectome. Stamp each reading here:[unverified]

  • 19 Nov 2026, block 26,446,008: 128,283 bytes as served (830,109 on disk), 729 pickers, 16,205 ties: the line is 7.8 times that. Taken as a browser takes it, asking for "gzip, deflate, br, zstd" (the server answers with gzip): curl -s -H 'Accept-Encoding: gzip, deflate, br, zstd' -o /dev/null -w '%{size_download}\n' https://pickipedia.xyz/assets/connectome/graph.json. Running gzip -9 on the file gives 120,764 bytes, but that isn't what the server sends.[unverified]
  • 20 Nov 2026, block 26,458,682: 308,492 bytes as served (2,005,150 on disk), 1,507 pickers, 43,800 ties. That's 2.4× the 19 Nov reading in a day, from the first walks, and the line is now 3.2 times that. Same curl as above.[unverified]

A second number: the cost of a click. The 1 MB line is about loading. What people feel first is each click. On 20 Nov Justin found the graph "much slower" after a deploy. re measured it on the live graph.json in Chromium. re's few runs had that day's code blocking 15–30% longer per click than the code before that day's merge, on the same data. blu's longer runs, taking turns between the two, found no difference, so the code was not the cause. With the CPU slowed 4×, the code from before that day's merge already took about 250 ms per click on that day's data. Most of a click's time went on layout and paint, not script: the slide redrew every mark on every frame. A drawing holds a few hundred marks (Cory Walker's: 160 circles and 101 lines), not every tie in the file. blu measured about 975 ms of main-thread time per click at 4× slow-down, and about 545 ms on pickipedia:blu/graph-evening, which redraws only what moves. Click cost is worth its own reading here because it can be felt well before the file reaches 1 MB.[unverified]

What the measurements said

blu, #connectome, 19 Nov 2026. The explorer, with production's code, was timed on copies of the live graph.json made bigger. Each copy is today's graph cloned N times, with the names suffixed and each clone tied into the ones before it by 30 random ties, so the search crosses all of them. They test size, not the shape of the real scene. The timing is in Chromium, throttled 4× at a phone's size, from the file landing to the graph drawn. It's not a real phone, and iOS is untested.[unverified]

  • 1×, today: 729 pickers, 16,205 ties, 0.12 MB gzipped. Drawn in 0.5–0.7 s, 10 MB heap.[unverified]
  • 4×: 2,916 pickers, 64,910 ties, 0.49 MB gzipped. Drawn in 1.0–1.1 s, 31 MB heap.[unverified]
  • 10×: 7,290 pickers, 162,320 ties, 1.22 MB gzipped. Drawn in 1.9 s, 72 MB heap.[unverified]
  • 40×: 29,160 pickers, 649,370 ties, 4.92 MB gzipped. Drawn in 5.4 s, 280 MB heap (2.3 s on a desktop, unthrottled).[unverified]

The copies' sizes are gzip -6 on the file. The server's gzip came out about 4% bigger on today's file: 128,283 bytes against 123,870.[unverified]

The line, 1 MB as served, falls near 7.8×, at about 126,000 ties. Reading between the 4× and 10× rows (not measured there), that's about 1.6 s and 57 MB.[unverified]

Until walk-dumb merges, the graph grows when someone merges new sources. Once it merges, the build walks Category:Walk Requested on its own. It fetches about 9 new sources per build (measured in a sandbox), and Jenkins builds every 5 minutes, so that's at most about 2,600 sources a day. At today's rate of about 10 ties a source, that reaches 10× in about six days, but only if the category holds that many requests. On 19 Nov it held no pickers.[unverified]

The plan when the number says so

This is blu's pick (19 Nov). Justin hasn't chosen it yet. The plan is to split the file. The browser loads a skeleton up front: who ties whom and how strongly, as typed arrays, plus the names for the search box. At 40× the skeleton is 1.38 MB gzipped and 6.5 MB of raw arrays and names (not yet measured in a browser), where the whole file is 4.92 MB gzipped and takes 280 MB of heap. Each picker's records, instruments and songs come in a small file of their own when they're drawn. It's still static files from the build, with no server of its own.[unverified]

Farther out, past a million-odd ties, the skeleton itself gets heavy: about 2 MB gzipped, scaled up from the 40× copy. At that point the path search moves server-side.[unverified]

Related