More embarrassing microbenchmars for D's GC.
Leandro Lucarella
llucax at gmail.com
Wed Jun 11 09:53:55 PDT 2008
Walter Bright, el 10 de junio a las 14:13 me escribiste:
> >But there is no GC activity there right?
>
> Instrument it to be sure.
Doesn't seems to be running. But it's weird you can tell for sure being
the author :S
> >>>2) Why is D malloc version ~33% slower than the C version? I took a look
> >>> at the generated assembly and it's almost identical:
> >>> <_Dmain+198>: lea -0x20(%ebp),%eax
> >>> <_Dmain+201>: lea 0x0(%esi,%eiz,1),%esi
> >>> <_Dmain+208>: addl $0x1,0x8(%eax)
> >>> <_Dmain+212>: adcl $0x0,0xc(%eax)
> >>> <_Dmain+216>: mov (%eax),%eax
> >>> <_Dmain+218>: test %eax,%eax
> >>> <_Dmain+220>: jne 0x804a240 <_Dmain+208>
> >>> <main+248>: lea -0x1c(%ebp),%eax
> >>> <main+251>: nop
> >>> <main+252>: lea 0x0(%esi,%eiz,1),%esi
> >>> <main+256>: addl $0x1,0x4(%eax)
> >>> <main+260>: adcl $0x0,0x8(%eax)
> >>> <main+264>: mov (%eax),%eax
> >>> <main+266>: test %eax,%eax
> >>> <main+268>: jne 0x8048550 <main+256>
> >>> <main+270>: movl $0x0,0x4(%esp)
> >>> <main+278>: movl $0x8049800,(%esp)
> >>>Tests attached.
> >>Without running a profiler, there's no way to be sure about just where in the
> >>code the time is being consumed.
> >Attached is the output of the gprof program (for the list-test-d-gc with
> >the GC running). I don't see any helpful information for the point 2), but
> >it shows clearly that most of the time is spent in garbage collection.
>
> Break up your code into more functions to get better info from the profiler.
Is this useful (kcachegrind screenshoots, using callgrind with
--dump-instr=yes and --trace-jump=yes):
http://llucax.com.ar/~luca/kcachegrind-d.png
http://llucax.com.ar/~luca/kcachegrind-c.png
--
Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/
----------------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145 104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------------
De tan fina la condesa, por no cagarse, reza.
-- Ricardo Vaporeso
More information about the Digitalmars-d
mailing list