Easy & huge GC optimizations

Etienne via Digitalmars-d digitalmars-d at puremagic.com
Fri May 23 11:47:43 PDT 2014


On 2014-05-23 2:08 PM, Chris wrote:
> Fair enough. But what about programs that allocate a lot and run for
> ages (a server app for example)?

A server app? Couldn't have asked me for a better example.

You can see my native events fork here (I'm working on replacing libevent):

https://github.com/globecsys/vibe.d/tree/native-events/source/vibe/core/events

I actually need to improve the GC because of this and a cache library 
I'm making for vibe.d:

https://github.com/globecsys/cache.d

If you have 10,000 connections, they each create a 64KB buffer in the GC 
and if you don't want to risk collection for every one in a few times a 
new connection comes in, you need to use some sampling. Using FreeLists 
and manual memory management is a bad idea because if you're going to 
need to copy segments into the GC anyways if you want to extend the 
lifetime of data received over the network.

I have to create a copy of that data serialized because of manual 
management. I could store just a pointer if I didn't need to go around 
the GC which loses 95% of its time collecting absolutely nothing.


More information about the Digitalmars-d mailing list