dofs: resolving a directory scans its children as the directory grows
Maintainer antworten meist innerhalb von 1 Tag
@aron-cf arbeitet bereits daran.
Seit 13.10.2026.
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
Looking up /wide gets slower as children are added under it, even though the lookup does not request a child. I found this while investigating file recovery in OpenMeld.
This reproduces with the resolver SQL and core schema taken directly from 0.5.1, ef00c0a790cb87887bf209fa87838cb1a281220b, without our application or its patches.
What happens
Looking up /wide, with 20,000 children:
Before: find /wide -> inspect its children -> discover the path is finished
After: find /wide -> discover the path is finished
Time for 100 lookups of the same directory, median of seven samples:
| Children in /wide | Original query | Three ordered joins |
|---|---|---|
| 100 | 3.61 ms | 0.97 ms |
| 1,000 | 15.54 ms | 0.55 ms |
| 5,000 | 86.61 ms | 1.07 ms |
| 20,000 | 327.57 ms | 0.73 ms |
Linux arm64, Node 24.21.0, SQLite 3.53.4, Docker limited to 1 CPU / 1 GiB, no swap. macOS with SQLite 3.51.2 shows the same trend. These are in-memory query timings, not whole-sync or production recovery timings.
Reproduce
Script, raw samples, query plans and proposed patch
Save repro.mjs, then run:
node repro.mjs > results.json
Requires Node 24+ and network access to download two pinned upstream source files. No npm packages. Setup is outside the timed section; the two variants alternate which runs first.
Cause and proposed fix
In resolveViaCte, SQLite joins directory entries before reading the next path segment. The directory lookup can use only the parent half of its existing primary key:
Before: SEARCH d USING PRIMARY KEY (parent_inode=?)
After: SEARCH d USING PRIMARY KEY (parent_inode=? AND name=?)
Changing the three recursive JOINs to CROSS JOINs keeps the segment ahead of the directory lookup. Predicates, result ordering and schema stay unchanged. No new index or cache.
The script checks equal results for five path shapes at each width. After applying the patch to the clean upstream source, all 37 resolver, symlink and stat tests passed. This is focused coverage, not a full runtime test.
May I submit a PR?
I read the contribution policy, so I have not opened a PR. Would you be willing to invite me to submit this fix with regression coverage? The three-join patch is in the reproduction above. I am happy to adjust it to your preferred approach.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 9.7k
- Forks
- 577
- Ø Merge
- 1 T. 17 Std.
- Gemergte PRs (30 T.)
- 75
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus cloudflare/computer
-
Export one file helper over workspace.fsEvtl. vergeben @aron-cf hat das vor 8 Tagen übernommen. Offenenhancement
cloudflare/computer#261 · 1 Kommentar · 1 Reaktion · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 30/100
cloudflare/computer#224 · 5 Kommentare · 1 Reaktion ·
Maintainer antworten meist innerhalb von 1 Tag
-
Always run the "next" computerd workflow on push to the `release` branchEvtl. vergeben @aron-cf hat das vor 19 Tagen übernommen. Offenbug
cloudflare/computer#222 · 2 Kommentare · 1 Reaktion · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
Workspace namespaces: more than one Workspace per Durable Object storageEvtl. vergeben @aron-cf hat das vor 20 Tagen übernommen. Offenenhancement
cloudflare/computer#219 · 1 Kommentar · 1 Reaktion · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
git: host-held credentials for model-driven clone, fetch, pull and pushEvtl. vergeben @aron-cf hat das vor 20 Tagen übernommen. Offenenhancement
cloudflare/computer#218 · 3 Kommentare · 1 Reaktion · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in cloudflare/computer
Ähnliche Issues
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 91/100
caelestia-dots/caelestia#534 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
bobadilla-tech/biasmarket.com#402 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
javvadivijayprasad/sel2pw#28 ·
-
Area: Infrastructure Chore Difficulty: Low Good First Issue Priority: Low
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
DouglasNeuroInformatics/OpenDataCapture#1836 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Two wording fixes: the init PROVIDER comment and the confirm page's ledeEvtl. vergeben @kurtbruns hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 83/100
Maintainer antworten meist innerhalb von 1 Tag