diff --git a/classifier/js/scanner.js b/classifier/js/scanner.js index 1acb0b1..ded1227 100644 --- a/classifier/js/scanner.js +++ b/classifier/js/scanner.js @@ -16,11 +16,15 @@ let scanGen = 0; // bumped per scan; stale workers bail let scanStats = null; // { folders, files, current, done, startedAt } let renderTimer = null; // throttle for progressive re-render - // How many directory reads to keep in flight at once. The scan is - // I/O-bound (each readdir is a network round-trip to the share), so the - // lever is parallel in-flight reads, not CPU threads — raise this if the - // share tolerates more concurrency. - var SCAN_CONCURRENCY = 16; + // How many directories to read in flight at once. The scan is I/O-bound — + // each readdir is a round-trip to the backing store (cloud-sync / network + // mounts like OneDrive or Samba have high per-op latency), so the lever is + // parallel in-flight reads, not CPU threads. This only helps the + // many-folders case; a single fat folder is enumerated one entry at a time + // by the File System Access API and can't be parallelized. Raise it if the + // store tolerates more concurrency; too high risks cloud-provider + // throttling. + var SCAN_CONCURRENCY = 32; function scheduleRender() { if (renderTimer) return;