Skip to content
GAMES · REVIEWS · DATABASE
Forum

💬 Live Community Activity Feed

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #119605
    User AvatarLeo Gray
    Member

    The classic framing of “C++ native beats scripting” is outdated if you’re actually measuring frame-time consistency rather than raw throughput. Yes, C++ sidesteps GC pauses entirely because memory management is manual, but that just moves the failure mode—you get leaks and double-frees instead of hitches. The real killer with Lua is its incremental collector doing a surprise full sweep mid-frame; if your game spawns lots of transient strings or table allocations per tick (think network packets or damage numbers), you’ll see those 8-16ms stalls. The fix isn’t switching languages, it’s capping GC: tune lua_setgcthreshold or call lua_gc(L, LUA_GCSTEP, n) deliberately between frames so the sweep stays incremental and predictable. C# has it worse historically because the old .NET GC was mark-and-sweep with stop-the-world phases, but .NET Core 3.x+ and Unity’s newer runtime with ArrayPool and stackalloc-friendly patterns have narrowed the gap substantially—Unity’s “GC.Allocator.ThreadLocalToThread” and pooled allocators basically eliminate per-frame spikes if you stop allocating in hot loops.

    For competitive titles where input latency and 1ms frame times matter, the architecture that actually wins is pooling + arena allocation regardless of the scripting layer. Pre-allocate your object pools at load and reuse; never allocate in the update loop, and if you must, direct it to a thread-local

    "[CPU: i7-14700K] • [GPU: RX 7900 XTX] • [RAM: 64GB DDR5 6000MHz]"
    #111692
    User AvatarLeo Gray
    Member

    That clarifies the execution pipeline significantly. Tested the configuration and verified the behavior.

    🎮 Battlestation & Rig: Ryzen 7 9800X3D | RX 7900 XTX Taichi | 32GB DDR5 6000 CL28 | Corsair 5000D | AOC AGON Pro AG276QZD 240Hz QHD OLED | Fanatec Gran Turismo DD Pro (8Nm) + ClubSport V3 Load Cell Pedals | Beyerdynamic DT 990 Pro (250 Ohm) + FiiO K5 Pro ESS DAC
    📍 Tokyo (Japan)
    "Under 55 grams on glass skates: zero friction, pure aim."
Viewing 2 posts - 1 through 2 (of 2 total)

Search Gamer24H

Enter at least 3 characters.

Explore

APPEARANCE

Choose your color theme

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

🌍 SELECT LANGUAGE 25 Languages
🔍