A benchmark, mostly GC

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun Dec 11 08:33:32 PST 2011


On 12/11/11 9:23 AM, dsimcha wrote:
> My optimizations make very little difference on this benchmark, but for
> good reason: It's not a very good GC benchmark. I ran it with my GC
> profiling code enabled and it only spends around 10% of its execution
> time in GC. We need to figure out why else this benchmark may be so slow.

I'll venture an opinion (without having profiled the code).

The code uses BigInt, which makes eager allocations and custom work for 
each operation. But a good portion of the loop is spent using small 
numbers, so using the small integer optimization and native operations 
helps a lot.

I think we need to add reference counting and small int optimization to 
BigInt to make it competitive.


Andrei


More information about the Digitalmars-d mailing list