Ugrás a tartalomra
JÁTÉKOK · ÉRTÉKELÉSEK · ADATBÁZIS
Fórum

Scripting Engine Overhead: C++ Native vs Lua/C# Garbage Collection Spikes: Competitive Benchmark Analysis and Hardver Interactions

Kezdőlap › Forums › Competitive E-sport & Pro Scene › Scripting Engine Overhead: C++ Native vs Lua/C# Garbage Collection Spikes: Competitive Benchmark Analysis and Hardver Interactions

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #118816

    I’ve been bench-marking script runtime overhead on my 4090 / i9-14900K rig, and I keep seeing GC spikes in C#-based game scripts dragging my frametime up to 12-15ms bursts, right in the middle of clutch moments. C++ native modules stay rock-solid at sub-1ms, but I’m hitting a wall trying to quantify the actual cost of interop marshalling between managed and unmanaged code. Before I sink more hours into this, I want to hear from people who’ve actually tuned this in a live competitive environment.

    What frametime delta do you consider the hard threshold where a GC pause becomes competitive-relevant in a fast-tick shooter? Have you anyone found workarounds like object pooling or manual arena allocation that actually eliminate the spikes, or is it just diminishing returns? And does the interop invocation overhead scale meaningfully with core count, or does it bottleneck on a single thread before you ever hit RAM bandwidth limits? I’m also curious whether you’ve seen the spikes worse on high-refresh 240Hz panels versus 144Hz, since lower frame windows leave less headroom for those hitches to register.

    ITX Battlestation: Ryzen 9 7950X3D | RTX 4080 Super | SF750 Platinum
    #119269
    User AvatarOwen Cox
    Member

    The core issue isn’t average FPS—it’s frame-time consistency, and that’s where garbage collectors bite you in competitive titles. With C#/.NET, you’re fighting the generational GC: Gen 0 collections are cheap but frequent, while Gen 2 full collections can stall the main thread for 10–50ms spikes, which shows up as micro-stutters during a clutch round even if your average holds at 240fps. The culprit is almost always heap allocation churn—box型 primitives, string concatenation in netcode callbacks, and per-frame LINQ or iterator allocations piling onto the finalizer thread. You can nearly eliminate this by staying in Span/Memory territory, using stackalloc for small buffers, and pooling every object that gets instantiated per-shot or per-player. C++ native sid

    "[Primary: Dell Alienware AW2725DF 360Hz QD-OLED] • [Secondary: Dell 27″ 4K IPS]"
    #123526
    User AvatarMason Parker
    Member

    The headline metric you should be chasing here isn’t average FPS—it’s the 1% lows and frame-time consistency, because that’s where GC spikes actually cost you in a live match. C# on the CLR will give you those nasty stop-the-world pauses during generation-2 collections, especially if your scripting logic is spawning transient objects (temp vectors, string allocations from logging, LINQ results) inside hot update loops. Lua’s incremental GC is friendlier because it spreads work across frames, but it still leaks periodic hitches if you’re allocating and discarding aggressively. In a competitive shooter, a 12ms GC pause on frame 4000 during a reload is the exact moment you lose a gunfight, and no amount of high average FPS masks that.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Keresés a Gamer24H-n

Írj be legalább 3 karaktert.

Felfedezés

MEGJELENÉS

Válassz színtémát

Automatikus mode follows your device and switches to Xbox, PlayStation, or Nintendo colors on matching stories. Your manual choice stays on this device.

🌍 VÁLASSZ NYELVET 25 Nyelv
🔍