Skip to content

Improved pipeline and performance on ARM with low mem#1325

Open
piotrasd wants to merge 1 commit into
simulot:mainfrom
piotrasd:main
Open

Improved pipeline and performance on ARM with low mem#1325
piotrasd wants to merge 1 commit into
simulot:mainfrom
piotrasd:main

Conversation

@piotrasd

Copy link
Copy Markdown

Fixes a hang that occurs on ARM devices after the "Assets found" counter completes. The root cause is that file discovery blocks waiting for album metadata to finish loading from the server. This patch buffers the discovery output channel so both stages run independently, parallelises album detail fetching across the worker pool, and adds a visible [Fetching album details...] progress indicator so the process no longer appears frozen.

Four targeted changes to reduce memory pressure and I/O overhead on 1 GB devices: sets GOMEMLIMIT to 800 MB so the Go garbage collector batches work instead of triggering on every heap growth; increases the SHA1 read buffer from 32 KB to 4 MB with a sync.Pool to cut SD card syscalls by ~99% per file; buffers the worker pool task channel so the main goroutine stays ahead of workers without stalling; and reduces the HTTP connection pool from 100 to 16 connections, saving ~700 KB of idle goroutine stacks.

…ter completes. The root cause is that file discovery blocks waiting for album metadata to finish loading from the server. This patch buffers the discovery output channel so both stages run independently, parallelises album detail fetching across the worker pool, and adds a visible [Fetching album details...] progress indicator so the process no longer appears frozen.

Four targeted changes to reduce memory pressure and I/O overhead on 1 GB devices: sets GOMEMLIMIT to 800 MB so the Go garbage collector batches work instead of triggering on every heap growth; increases the SHA1 read buffer from 32 KB to 4 MB with a sync.Pool to cut SD card syscalls by ~99% per file; buffers the worker pool task channel so the main goroutine stays ahead of workers without stalling; and reduces the HTTP connection pool from 100 to 16 connections, saving ~700 KB of idle goroutine stacks.
@piotrasd piotrasd requested a review from simulot as a code owner March 14, 2026 11:11
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