Linked by Thom Holwerda on Thu 6th Sep 2012 21:32 UTC, submitted by MOS6510
Benchmarks "During the 4th Semester of my studies I wrote a small 3d spaceship deathmatch shooter with the D-Programming language. It was created within 3 Months time and allows multiple players to play deathmatch over local area network. All of the code was written with a garbage collector in mind and made wide usage of the D standard library phobos. After the project was finished I noticed how much time is spend every frame for garbage collection, so I decided to create a version of the game which does not use a GC, to improve performance."
Permalink for comment 534153
To read all comments associated with this story, please click here.
Comparison conclusion: use GC everywhere!
by sergio on Fri 7th Sep 2012 00:19 UTC
sergio
Member since:
2005-07-06

Well, the author don't tell us how much additional development time the manual memory management had taken. So I will take into account only performance:

Best GC Version: 128.6 FPS, 7.72 ms frametime
Manual Version: 142.8 FPS, 7.02 ms frametime

This a 11% performance improvement for an unknown amount of additional work.

And here We're taking about a worst case scenario for a GC: a game is 100% interactive and real time application. Even so We only lost 11% of performance.

In other words: the max price you have to pay for using a GC is 11% performance loss.

How much performance improvement would We had in a traditional online non-real-time system? 2%? How many memory leaks We "gain"? How many additional programmer hours would We have to pay?

Hey, I'm think this study is the perfect apology of GC use. We have to use GC all the time even with games!

Reply Score: 2