Skip to main content
← Back to list
01Issue
BugOpenSwamp CLIPublic
AssigneesNone

Relationships

#4301 serve resolves realpath for thousands of files under .swamp/outputs/swamp/worker/set_status

Opened by zack · 11/2/2026

Follow-up from swamp-club#4280; reported in the same measurements.

A 3-second strace of an idle swamp serve showed 833 realpath-style walks, each about 12 readlink calls, so about 3,000 failing readlink calls per second. 48% of them resolve paths under .swamp/outputs/swamp/worker/set_status, which held 24,215 files at the time. Running swamp run gc by hand removed 36,623 outputs and cut statx calls about 10x, so the cost scales with the size of the outputs directory between gc runs.

Find which serve path canonicalizes every output file (likely an output listing or search that calls realPath or assertSafePath per entry), and avoid per-file realpath for files directly inside a directory already known to be contained. Also consider whether worker set_status outputs need to be persisted per call at all.

02Bog Flow
◉OPEN○TRIAGED○IN PROGRESS○SHIPPED

Open

11/2/2026, 4:39:28 PM

No activity in this phase yet.

03Sludge Pulse

Sign in to post a ripple.