mirror of
https://github.com/pnpm/pnpm.git
synced 2026-04-16 05:00:30 -04:00
Move SQLite reads/writes, JSON.parse, semver matching, and version picking from the main thread to the existing worker pool. The main thread is now a thin orchestrator that only does network I/O. Resolution uses at most 2 round-trips to the worker: 1. Worker checks SQLite cache → cache hit returns immediately 2. On cache miss, main thread fetches from registry, sends raw JSON to worker → worker parses, writes cache, picks version This unblocks the main event loop during resolution — network I/O, tarball downloads, and linking can proceed while the worker does CPU-heavy parsing and semver matching.