Skip to content

refactor: parallelize parse spectra pipeline across concurrent worker… - #141

Merged
NishaSharma14 merged 1 commit into
developmentfrom
fix-parse-spectra-timeout
Sep 1, 2026
Merged

refactor: parallelize parse spectra pipeline across concurrent worker…#141
NishaSharma14 merged 1 commit into
developmentfrom
fix-parse-spectra-timeout

Conversation

@hamed-musallam

Copy link
Copy Markdown
Collaborator

…/browser lanes

Replace the single-threaded, one-browser-per-spectrum flow with a fixed number of concurrent lanes, each owning a persistent worker thread (CPU processing/detection) and, when snapshots are enabled, a persistent browser page:

  • run-pipeline.ts / run-concurrency.ts: drive parse -> process -> detect -> snapshot across N lanes instead of one spectrum at a time.
  • spectrum-worker.ts / worker-entry.ts: offload processing, detection, and serialization to worker threads so CPU work no longer blocks the main thread.
  • browser-manager.ts: reuse one browser/context per lane across every spectrum it handles, instead of relaunching per spectrum.
  • prase-spectra.ts: delegate to the new pipeline; stream output via outputResult instead of buffering the full result in memory.

…/browser lanes

Replace the single-threaded, one-browser-per-spectrum flow with a fixed
number of concurrent lanes, each owning a persistent worker thread (CPU
processing/detection) and, when snapshots are enabled, a persistent
browser page:

- run-pipeline.ts / run-concurrency.ts: drive parse -> process -> detect
  -> snapshot across N lanes instead of one spectrum at a time.
- spectrum-worker.ts / worker-entry.ts: offload processing, detection,
  and serialization to worker threads so CPU work no longer blocks the
  main thread.
- browser-manager.ts: reuse one browser/context per lane across every
  spectrum it handles, instead of relaunching per spectrum.
- prase-spectra.ts: delegate to the new pipeline; stream output via
  outputResult instead of buffering the full result in memory.
@NishaSharma14
NishaSharma14 marked this pull request as ready for review September 1, 2026 13:04
@NishaSharma14
NishaSharma14 merged commit 1c39986 into development Sep 1, 2026
1 check passed
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.

2 participants