Smart pointers instead of GC?

Ola Fosheim Grøstad" <ola.fosheim.grostad+dlang at gmail.com> Ola Fosheim Grøstad" <ola.fosheim.grostad+dlang at gmail.com>
Mon Feb 3 16:14:21 PST 2014


On Monday, 31 December 2012 at 12:14:22 UTC, Sven Over wrote:
> In my job I'm writing backend services that power a big web 
> site. Perfomance is key, as the response time of the data 
> service in most cases directly adds to the page load time. The 
> bare possibility that the whole service pauses for, say, 100ms 
> is making me feel very uncomfortable.

Back to the original scenario:

Current CPUs have a measured peak throughput of 2-4GB per 100ms. 
So if you keep pointers clustered on cache lines in a way that is 
compatible with the AGCs prefetching patterns, then you ought to 
make it for most applications if the collector is optimized?

If your backend service (data) is replicated on multiple servers 
you could, of course, let the servers run the GC at different 
times organized with a load-balancer/router/task scheduler.

So if GC makes you more productive on a web server then I don't 
really see why you don't use it.

Now, that might not work out in the future though. If CPU caches 
keep growing to the extent that most of your working dataset sits 
in the cache and you have lots of rather slow main memory then 
the AGC process will become sloooow no matter how good the GC is.


More information about the Digitalmars-d mailing list