DirectStorage: keep unpacked file requests on disk and read them back (plan) #2863
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by ozimchuk on 2026-11-26T19:48:25Z.
Plan: an opt-in
XCL_DSTORAGE_CACHE=<folder>. XCL keeps the unpacked bytes of each decoded DirectStorage file request (zlib and BCPack) in the folder. When the same request comes again (same file, size and modification time, offset, source size and decoding), XCL reads the kept bytes instead of decoding again. That covers the same run and every later one. The title's files are not touched, and nothing is title-specific.Why: the CPU decodes the same streamed data again in every run. On a retail title under Linux, the first 80 s decode 3.5–4.4 GB of zlib output and 80–120 MB of BCPack blocks, which costs 10–14 s of worker time. With the bytes kept from an earlier run, that drops to 0.1–0.3 s, and the time requests spend on the DirectStorage worker roughly halves. Even the first run finds 2,000–5,000 of its own requests again. #1722 (zlib-rs) makes the decode faster, and this avoids it; the two do not conflict.
Limits I'd propose:
XCL_DSTORAGE_CACHE_MB(default 32 GB).XCL_DSTORAGE_PARALLEL_DECOMPRESSkeeps its own path, without the cache.I have it working, about 570 lines, 200 of them tests. I'd open it as a draft PR unless this is a direction you'd rather not take.
AI-assisted. Claude Code, Claude Opus 5.5 wrote the code, made the measurements and wrote this.