Finding (performance-audit, 0300 run 2026-09-12)
Speculative — evaluate whether this is worth doing. Implementation is explicitly NOT the todo.
bin/libby.mjs:494-501 archives targets in a strict for…of await loop: with N loans, wall-clock is the sum of per-title archives. Within a single title, part downloads already run with bounded concurrency (mapLimit, src/pool.mjs), and HTTP keep-alive pooling landed in W7 — cross-title serialization is the remaining structural serialization in the heaviest command.
Why evaluate first, not implement
- Rate-limit tradeoff is an owner call: OverDrive throttles ("whoa", handled at
bin/libby.mjs:506-511 with exit 3). Cross-title concurrency multiplies concurrent sockets against OverDrive hosts; whether N=2 is safe vs. whoa-prone needs a measured answer, not a guess.
- Measurement infra doesn't exist: an honest before/after needs a simulated multi-title archive (net-sim harness driving
archiveAudiobook/archiveReadable with mocked clients) or real downloads; neither is built.
- Error-semantics design: today a mid-loop failure logs
FAILED "title" and continues; whoa exits 3. Parallel completion interleaves logs and can surface several failures/whoas per run — the semantics need re-specifying before code.
Evaluation questions for the owner
- Is a bounded
mapLimit(targets, 2) (or 3) archive loop worth building given whoa risk?
- If yes, fund the net-sim multi-title harness so the win is measured, not assumed.
Evidence
bin/libby-archiver src: serial loop at bin/libby.mjs:494-501; per-title concurrency at src/archive.mjs:20/src/archive-read.mjs:27 (mapLimit).
- Context: W7 keep-alive pooling (bb616b3, perf-notes-net.md) removed per-request handshakes; T2 waves optimized loops/RAM.
Finding (performance-audit, 0300 run 2026-09-12)
Speculative — evaluate whether this is worth doing. Implementation is explicitly NOT the todo.
bin/libby.mjs:494-501archives targets in a strictfor…of awaitloop: with N loans, wall-clock is the sum of per-title archives. Within a single title, part downloads already run with bounded concurrency (mapLimit,src/pool.mjs), and HTTP keep-alive pooling landed in W7 — cross-title serialization is the remaining structural serialization in the heaviest command.Why evaluate first, not implement
bin/libby.mjs:506-511with exit 3). Cross-title concurrency multiplies concurrent sockets against OverDrive hosts; whether N=2 is safe vs. whoa-prone needs a measured answer, not a guess.archiveAudiobook/archiveReadablewith mocked clients) or real downloads; neither is built.FAILED "title"and continues;whoaexits 3. Parallel completion interleaves logs and can surface several failures/whoas per run — the semantics need re-specifying before code.Evaluation questions for the owner
mapLimit(targets, 2)(or 3) archive loop worth building given whoa risk?Evidence
bin/libby-archiversrc: serial loop atbin/libby.mjs:494-501; per-title concurrency atsrc/archive.mjs:20/src/archive-read.mjs:27(mapLimit).