Skip to content

fix(size): Keep demangle parallelism inside binary analysis workers - #671

Merged
NicoHinderling merged 1 commit into
mainfrom
fix/worker-demangle-parallelism
Sep 3, 2026
Merged

fix(size): Keep demangle parallelism inside binary analysis workers#671
NicoHinderling merged 1 commit into
mainfrom
fix/worker-demangle-parallelism

Conversation

@NicoHinderling

@NicoHinderling NicoHinderling commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #663. After the parallel binary analysis rolled out to EU, a re-upload of a customer iOS build hit the 900s task deadline. The 4-worker pool phase itself finished cleanly (18 binaries started, 17 completed within four seconds), but the main app binary, which has 1.6M Swift symbols, never completed: its demangle ran for 14 minutes until taskbroker killed the task. The same binary demangled in about 333s under the old serial analyzer, where the whole build took 387s.

The cause is the worker initializer setting LAUNCHPAD_NO_PARALLEL_DEMANGLE=true. That was added during review to bound subprocess count, so four workers could not each fan out to four cwl-demangle threads. But it turned the heaviest binary, which is the critical path, from four demangle threads into one, and 3200 sequential chunks do not fit under the deadline. Parallelism across binaries does not help when one binary dominates.

This drops the override so each worker keeps the same four demangle threads the serial path had. Worst case is sixteen concurrent cwl-demangle subprocesses on a 4-CPU pod while several heavy binaries overlap. Throughput is CPU-bound either way, so the phase does not get slower, and each subprocess handles a 500-symbol chunk and exits, so memory stays bounded. The remaining thing to watch is the 10s per-chunk timeout under contention, since timed-out chunks are silently dropped rather than failing the build; if those show up on large apps the fix is a longer chunk timeout, not restoring the cap.

Existing worker and parallel-vs-in-process integration tests pass; there was no test asserting the env var. To verify after deploy: re-upload the customer build and check its trace for completion and for any demangle timeout errors.

The worker initializer disabled cwl-demangle's thread fan-out so the
four-worker pool could not multiply into sixteen demangle subprocesses.
That cap turned the heaviest binary into a single-threaded critical
path: a main binary with 1.6M Swift symbols that demangled in about
333s under the serial analyzer now runs its 3200 chunks one at a time
and blows through the 900s task deadline.

Drop the override so each worker keeps the same four demangle threads
the serial path had. Oversubscription only occurs while several heavy
binaries overlap, and each subprocess handles a 500-symbol chunk and
exits, so memory stays bounded.
@sentry

sentry Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Size Analysis

2 components analyzed

iOS Builds

Name Configuration Version Download Size Install Size
HackerNews (iOS)
com.emergetools.hackernews
Release 3.8 (1) 6.5 MB (0 B) 9.7 MB (0 B)

Android Builds

Name Configuration Version Download Size Uncompressed Size
Hacker News (Android)
com.emergetools.hackernews
Release 1.0.2 (13) 2.9 MB (-26 B) 6.6 MB (+4 B)

Configure launchpad-test-ios status check rules

@sentry

sentry Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

📲 Install Builds

iOS

🔗 App Name App ID Version Configuration
HackerNews com.emergetools.hackernews 3.8 (1) Release

Android

🔗 App Name App ID Version Configuration
Hacker News com.emergetools.hackernews 1.0.2 (13) Release

⚙️ launchpad-test-ios Build Distribution Settings

@NicoHinderling
NicoHinderling merged commit f408109 into main Sep 3, 2026
25 checks passed
@NicoHinderling
NicoHinderling deleted the fix/worker-demangle-parallelism branch September 3, 2026 23:51
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