3 ms·
It seems to me like you should just be using D, not "Better C-style D"? All those features are not in BetterC because they need a garbage collector, but they ar
by FeepingCreature 8y ago
It seems to me like you should just be using D, not "Better C-style D"? All those features are not in BetterC because they need a garbage collector, but they are of course in D proper. For smaller projects, I'd recommend just ignoring the GC until you run into actual issues with it, then optimizing for the specific issues.
- comex 8y agoThat's easy to say, but as long as C++ and other languages can do those things without a garbage collector, D seems somewhat less attractive. (I'm not the OP but I've had a similar experience with D.)
- WalterBright 8y agoYou can do all of them without a garbage collector - you just have explicitly manage the memory yourself.
- makomk 8y agoAs I understand it, garbage collection is kind of a non-starter for games programming because it leads to unpredictable pauses in what should be a low-latency, interactive application.
- bausshf 8y agoIt is optional however and you can use custom allocators to get around it.
- p0nce 8y agoInfognition has found that if you keep the D GC heap under 100k the max pauses will be about 1 ms. The means to reduce GC usage have only grown more diverse in recent years: - std.experimental.allocator - @nogc to ensure, well, no GC usage - various things built on placement new (`emplace`) - GC profiling with -profile=gc, will display number of allocations and size None of this existed when people were already making high-performance systems with D...
- qznc 8y agoYou can put the low-latency stuff in a non-gc thread which will not be interrupted [0] and still use the convenient garbage collector for the rest. [0] https://p0nce.github.io/d-idioms/#The-impossible-real-time-thread https://p0nce.github.io/d-idioms/#The-impossible-real-time-t...
- xxs 8y agoYou can have low pause, fully concurrent GC even in Java. A GC can utilize read barriers and overall eliminate stop-the-world pauses. --- A popular example is minecraft that uses mainstream G1 GC.