Skip to content

Concurrency scaling is sub-linear: 4x jobs (8->32) only buys ~1.5x wall-clock #2

Description

@awto-au

Observation

Two full-corpus baseline runs (510 .c TUs, same c2rust rev 67df081, same corpus rev) back to back on the same host:

jobs wall-clock per-file p50 per-file p90 per-file max peak RSS p50/p90/max
8 ~5m40s 5.1s 8.5s 23.4s 532MB / 649MB / 767MB
32 ~3m43s 12.1s 22.3s 71.3s similar range

Peak RSS per process barely changed between the two runs, and host memory never dropped below ~30GB available (of 62GB total) at 32 jobs — this isn't a memory-pressure story. But per-file wall-clock roughly tripled going from 8 to 32 concurrent jobs, so a 4x increase in concurrency only bought a ~1.5x reduction in total wall-clock. That's well short of linear scaling and suggests real contention somewhere other than RAM.

What to find out

  • Is this just CPU oversubscription (32 jobs on 32 logical cores, plus OS/desktop overhead, is a reasonable ceiling and this is simply expected diminishing returns)? Or is there contention specific to c2rust's own process — e.g. Clang's -nostdinc/header search re-parsing the same kernel headers independently in every process (no shared PCH/module cache across invocations), lock contention in a shared resource, or filesystem I/O contention writing overlapping AST-export intermediate state?
  • Would a -fmodules/precompiled-header approach, or some other shared-state mechanism between concurrent c2rust transpile invocations, meaningfully cut the per-file cost under concurrency?

Context

Measured via linux-rs's scripts/run_c2rust_baseline.py (adaptive --jobs, now computed from real peak-RSS history instead of the RLIMIT_AS ceiling) against this fork's corpus of kernel .c files. Not urgent — current throughput is usable — but worth understanding before assuming higher concurrency is free.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4Known limitation / investigation, not an active fix target

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions