www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - GC hack

reply BERO <berobero users.sourceforge.net> writes:
I made 2 of another GC.

Boehm GC
 Use boehm GC instead of original gc.
 Note: Unfortunely, boehm gc is slower than original GC

Atomic GC<
 GC do not scan array of element size<4 such as char[]
 Note: GC spend time is 1/3 with big size array, but bit slow down with
small size array

http://wxd.sourceforge.net/misc.html

BERO
Mar 24 2005
parent reply "Ben Hinkle" <ben.hinkle gmail.com> writes:
Neat stuff. Have you run more tests than the two you posted? It would be 
nice to see more data.
And about the atomic collector, can that behavior be put into DMD's gc by 
default? If it is better it should be standard.

I'm impressed you've been making alot of progress on both this GC stuff and 
wxD. Very cool and keep it up!

-Ben

"BERO" <berobero users.sourceforge.net> wrote in message 
news:d1tso3$1j3t$1 digitaldaemon.com...
I made 2 of another GC.

 Boehm GC
 Use boehm GC instead of original gc.
 Note: Unfortunely, boehm gc is slower than original GC

 Atomic GC<
 GC do not scan array of element size<4 such as char[]
 Note: GC spend time is 1/3 with big size array, but bit slow down with
 small size array

 http://wxd.sourceforge.net/misc.html

 BERO 
Mar 24 2005
parent reply bero <berobero users.sourceforge.net> writes:
Ben Hinkle wrote:
 Neat stuff. Have you run more tests than the two you posted? It would be 
 nice to see more data.
 And about the atomic collector, can that behavior be put into DMD's gc by 
 default? If it is better it should be standard.
Not so much tested. Atomic gc is small modified version of original GC. so easly replace default version. put it in dmd/src/phobos/internal/gc and recompile phobos. atomic gc works that: dmd generates: foo = new char[len] bar = new int[len] baz = new (char*)[len] fall into: foo = _d_new(len,char.sizeof) -> d_new(len,1) - (a) bar = _d_new(len,int.sizeof) -> d_new(len,4) - (b) baz = _d_new(len,(char*).sizeof) -> d_new(len,4) - (c) modified version of _d_new treats (a) is atomic, but can't know (b) and (c) is atomic or not, so both treats as non atomic. I hope dmd genelate in the feature: foo = _d_new_atomic(len,char.sizeof) bar = _d_new_atomic(len,int.sizeof) baz = _d_new(len,(char*).sizeof) BERO
Mar 25 2005
parent "Lionello Lunesu" <lio lunesu.removethis.com> writes:
Hi Bero,

Why is atomic gc slower for many small arrays? Where's the overhead? It 
seems that the only overhead is in _d_new, something like "if (size<4) 
dont_scan(ptr);" or so (I don't know the code).

Is there overhead when new-ing or when checking the roots during collecting?

Lionello. 
Mar 25 2005