Skip to content

Restore as many files at a time as the drive does best, with progress - #55

Open
ChakraFusion wants to merge 1 commit into
Liquid-co:dev-publicfrom
ChakraFusion:pr/parallel-restore
Open

ChakraFusion wants to merge 1 commit into
Liquid-co:dev-publicfrom
ChakraFusion:pr/parallel-restore

Conversation

@ChakraFusion

Copy link
Copy Markdown

As offered in #21.

  • internal/iopar runs many small file operations at whatever concurrency suits the drive: 1 on an HDD, starting at 8 on a SATA SSD and 32 on NVMe, then adapting every 750 ms. Drive type comes from the seek penalty and bus type on Windows, and from rotational / nvme on Linux.
  • A restore creates every folder once, then writes the files through iopar. Restoring Project Zomboid (238,410 files) on a 4-thread PC: 2 min 29 s → 1 min 42 s.
  • The game header shows the restore phase, percentage and time left (restoring in the game payload).

Tests: iopar (settles near the drive's best, three runs since it's timed with sub-millisecond sleeps; HDD one at a time; every item once with monotonic progress; stops at the first error); frontend progress formatting.

🤖 Generated with Claude Code

Putting a large save back - a quarter of a million files - wrote them one
after another, looking up each one's folder again, while the drive sat at
90% active time and 15 MB/s, and the window showed a spinner for many
minutes with nothing to say what it was doing.

- internal/iopar runs many small file operations as many at a time as
  suits the drive they are on: one at a time on a hard disk, starting at
  8 on a SATA SSD and 32 on NVMe (Windows: the volume's seek penalty and
  bus type; Linux: rotational and nvme). On an SSD the number then moves
  every 750 ms the way that finishes more - on while it helps, back when
  it hurts, and now and then the other way once settled, so a drive that
  slows as it goes is followed.
- A restore makes every folder once, then writes the files through it;
  checking the archive reads its entries through it too. On a 4-thread
  machine restoring Project Zomboid (238,410 files) the processor, not the
  SSD, is the limit: writing went from 2m29s to 1m42s, settling at 3-8 at
  once; machines with more cores go further by themselves.
- A restore says how far it is - rebuilding a compacted snapshot,
  checking it, writing the files - with percent and, once it can be told,
  the time left, in the game's header ("restoring" in the game payload).

The drive-adaptation test is timed with sub-millisecond sleeps, so it
gets three runs and one has to settle near the best; a broken adaptation
misses in all three.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@vercel

vercel Bot commented Oct 14, 2026

Copy link
Copy Markdown

@ChakraFusion is attempting to deploy a commit to the sivadaboi's projects Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant