Skip to content

Performance upgrades#198

Merged
s-andrews merged 4 commits into
masterfrom
performance
May 21, 2026
Merged

Performance upgrades#198
s-andrews merged 4 commits into
masterfrom
performance

Conversation

@s-andrews
Copy link
Copy Markdown
Owner

Pulling in the new threading model and performace upgrades which give about a 4X speed improvement. Thanks to @ewels and other Seqera people for pulling this together.

ewels and others added 4 commits May 21, 2026 07:53
AnalysisRunner now runs as one reader thread plus three processor
threads. The reader batches Sequences (1024 per batch) and pushes each
batch reference onto N ArrayBlockingQueues. Each processor drains its
own queue and runs an evenly split subset of the QCModule array, so
modules stay single-threaded per processor and no in-module locking is
needed.

Progress callbacks (analysisUpdated) are fired from the reader thread
at the same cadence as the previous single-threaded version (every
batch boundary, gated on a 5% file-position advance).

Co-Authored-By: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
AnalysisQueue treats -t as a total-thread budget and splits it between
outer concurrency (files in parallel) and inner concurrency (per-file
reader + processor pipeline):

    processorsPerFile = min(MAX_PROCESSORS_PER_FILE, totalThreads - 1)
    outerSlots        = max(1, totalThreads / (1 + processorsPerFile))

When -t is unset, OfflineRunner now tells AnalysisQueue how many files
the run has via configure(); the default becomes
min(THREADS_PER_FILE * max(1, expectedFiles), availableProcessors), so
a single file gets the full per-file pipeline and many files scale up
to the host's CPU count without the user needing to set -t.

A budget of one CPU makes AnalysisRunner take its single-threaded path
so -t 1 produces byte-identical behaviour to the unbatched runner.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
~3x run time speedup using parallel processing
@s-andrews s-andrews merged commit b6bc4b9 into master May 21, 2026
1 check failed
@s-andrews s-andrews deleted the performance branch May 21, 2026 14:55
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