www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - I wish Dlang had incremental and concurrent garbage collection

reply James Lu <jamtlu gmail.com> writes:
I have a single-threaded, highly stateful application, a 
networked multiplayer game. It must run on the server at 25FPS. 
What progress is there on giving D a GC mode that "spreads out" 
the cost of doing GC?
Jan 11 2020
next sibling parent bauss <jj_1337 live.dk> writes:
On Saturday, 11 January 2020 at 21:10:45 UTC, James Lu wrote:
 I have a single-threaded, highly stateful application, a 
 networked multiplayer game. It must run on the server at 25FPS. 
 What progress is there on giving D a GC mode that "spreads out" 
 the cost of doing GC?
What's stopping you from creating multiple threads? You can easily have a network thread and a UI thread and simply pass any data to the network thread from the UI thread and the other way around too using std.concurrency. I've done that myself and it works fine and can definitely run at a faster FPS than 25 too.
Jan 30 2020
prev sibling parent reply JN <666total wp.pl> writes:
On Saturday, 11 January 2020 at 21:10:45 UTC, James Lu wrote:
 I have a single-threaded, highly stateful application, a 
 networked multiplayer game. It must run on the server at 25FPS. 
 What progress is there on giving D a GC mode that "spreads out" 
 the cost of doing GC?
Have you actually done any profiling that shows that D's GC is preventing you from achieving 25 FPS? 25 FPS is 40 ms, I don't know how much your update loop takes, but I don't think the D GC pauses would be this long?
Jan 31 2020
parent Joseph Rushton Wakeling <joseph.wakeling webdrake.net> writes:
On Friday, 31 January 2020 at 10:35:45 UTC, JN wrote:
 Have you actually done any profiling that shows that D's GC is 
 preventing you from achieving 25 FPS? 25 FPS is 40 ms, I don't 
 know how much your update loop takes, but I don't think the D 
 GC pauses would be this long?
Note also that it's also readily possible to architect a D app to use resource pools, reusable buffers, etc. such that GC cycles are never triggered.
Feb 01 2020