Does Nim’s experimental ARC GC reduce latency spikes under high async load?
0 reputation · 14 Mar 2025, 01:59 UTC
Goal
Determine if Nim’s experimental ARC garbage collector mitigates latency spikes that appear only under concurrent async requests.
Constraints
In Nim 2.x the default Boehm GC pauses the entire runtime during collection, which can cause noticeable delays when a burst of async or thread‑based requests triggers frequent collections. The asyncdispatch event loop runs on a single OS thread; CPU‑bound async tasks that never yield can monopolize the loop, further inflating latency bursts. The ARC GC is experimental, not yet stable, and its impact on pause duration under high load is unknown.
Questions
What pause reductions can be expected when switching from Boehm to ARC in a high‑concurrency async workload?
How does ARC affect the single‑threaded asyncdispatch loop and CPU‑bound task scheduling?
Are there known stability or compatibility issues that would preclude using ARC in production?