Skip to content

perf(importer): raise default max_download_prefetch from 3 → 10#359

Merged
javi11 merged 2 commits intomainfrom
fix/7z-import-speed
Feb 26, 2026
Merged

perf(importer): raise default max_download_prefetch from 3 → 10#359
javi11 merged 2 commits intomainfrom
fix/7z-import-speed

Conversation

@javi11
Copy link
Copy Markdown
Owner

@javi11 javi11 commented Feb 26, 2026

Summary

  • Raises the global MaxDownloadPrefetch default from 3 → 10, improving archive analysis throughput for both 7z and RAR
  • Removes the sevenZipPrefetch() multiplier helper introduced in 7-Zip archives use single connection on Sonarr import #101, eliminating the 7z-specific special-case
  • Both processors now receive the same prefetch value — simpler code, consistent behaviour

Motivation

#101 added a sevenZipPrefetch() helper that tripled the base prefetch (min 10) for 7z archives only. The simpler and equally effective fix is to raise the global default to 10, which benefits all archive types without extra indirection and removes the asymmetry between the RAR and 7z processors.

Changes

File Change
internal/config/manager.go MaxDownloadPrefetch default 310
internal/importer/processor.go Remove sevenZipPrefetch() helper; pass maxDownloadPrefetch directly

Test plan

  • go build ./... passes
  • go test ./internal/importer/... passes
  • Manual smoke-test: import a 7z-packed NZB and verify faster analysis

🤖 Generated with Claude Code

javi11 and others added 2 commits February 26, 2026 15:42
Adds a sevenZipPrefetch(base) helper that returns max(base×3, 10).
The 7z processor now gets 3× more concurrent segment prefetch than the
configured base value, ensuring multiple NNTP connections are kept busy
during 7z stream analysis instead of downloading one segment at a time.

The RAR processor is unchanged and continues to use the configured
maxDownloadPrefetch value.

Closes #101

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Raises the global MaxDownloadPrefetch default from 3 to 10, benefiting
both 7z and RAR archive analysis without special-casing either format.
Removes the sevenZipPrefetch() multiplier helper that was introduced in
#101, keeping the codebase simpler and the behaviour consistent.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@javi11 javi11 changed the title perf(7z): triple segment prefetch to saturate NNTP connections during 7z import perf(importer): raise default max_download_prefetch from 3 → 10 Feb 26, 2026
@javi11 javi11 merged commit 72a9683 into main Feb 26, 2026
1 check passed
@javi11 javi11 deleted the fix/7z-import-speed branch February 26, 2026 15:10
drondeseries referenced this pull request in drondeseries/altmount_old Apr 16, 2026
* perf(importer): raise default max_download_prefetch from 3 to 10

Raises the global MaxDownloadPrefetch default from 3 to 10, benefiting
both 7z and RAR archive analysis without special-casing either format.
Removes the sevenZipPrefetch() multiplier helper that was introduced in
#101, keeping the codebase simpler and the behaviour consistent.
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.

1 participant