News for hackers. Stuff that matters.
Re:Why I Write Games in C (yes, C) by kllrnohj on Saturday September 21, 2019 @02:47PM (#21037130)
One of the key other things that surprisingly hasn't been mentioned is it's super important to control memory layout.

GC pause times are relevant but not critical. What's critical is that I can lay out my objects to maximize locality, prefetching, and SIMD compatibility. Look up Array of Structs vs Struct of Arrays for discussions on aspects of this.

This is not strictly incompatible with a GC in theory, however it's common that in GC'd languages this is either very difficult or borderline impossible. The JVM's lack of value types, for example, makes it pretty much game over. Combining a GC with good cache locality and SoA layout is possible, but it doesn't really exist, either. Unity's HPC# is probably the closest, but they banned GC allocations to do it.

There are no comments on this comment yet.