List of Phobos functions that allocate memory?

Sean Kelly sean at invisibleduck.org
Fri Feb 7 07:35:05 PST 2014


On Friday, 7 February 2014 at 15:33:01 UTC, Adam D. Ruppe wrote:
> On Friday, 7 February 2014 at 11:37:16 UTC, Ola Fosheim Grøstad 
> wrote:
>> How slow is slow? Is it slower than in Go and Python?
>
> One problem with allocating the exception is the stop-the-world 
> thing. My cgi.d's built in httpd does some allocations in its 
> constructor, which is run once per request. It can answer 
> requests at a rate of about 6000/sec on my computer...
>
> Until the allocation have gone too much and the GC starts 
> running. Then all the pending requests stop, killing the 
> throughput.
>
> (BTW, interestingly, on Linux it uses separate process pools 
> instead of threads. The GC does NOT stop the world since the 
> other processes can keep going. But, if the requests are fairly 
> uniform - as is typically the case with benchmarks - each 
> process hits the GC threshold at about the same time.... 
> ironically, it is the deterministic nature of the GC that leads 
> to the performance killer there.)

It's obviously not a solution, but you could change that by 
having each process call GC.reserve() with a different size.


More information about the Digitalmars-d mailing list