--Jon
Reserving capacity in associative arrays
Jon D via Digitalmars-d-learn Sun, 14 Feb 2016 19:26:37 -0800
Is there a way to reserve capacity in associative arrays? In some
programs I've been writing I've been getting reasonable
performance up to about 10 million entries, but beyond that
performance is impacted considerably (say, 30 million or 50
million entries). GC stats (via the "--DRT-gcopt=profile:1"
option) indicate dramatic increases in gc time, which I'm
assuming comes from resizing the underlying hash table. I'm
guessing that by preallocating a large size the performance
degradation would not be quite so dramatic. The underlying
implementation of associative arrays appears to take an initial
number of buckets, and there's a private resize() method, but
it's not clear if there's a public way to use these.
- Reserving capacity in associa... Jon D via Digitalmars-d-learn
- Re: Reserving capacity i... sigod via Digitalmars-d-learn
- Re: Reserving capaci... Jon D via Digitalmars-d-learn
- Re: Reserving capacity i... Steven Schveighoffer via Digitalmars-d-learn
- Re: Reserving capaci... Basile B. via Digitalmars-d-learn
- Re: Reserving ca... Jon D via Digitalmars-d-learn
- Re: Reserving capaci... Jon D via Digitalmars-d-learn
- Re: Reserving ca... H. S. Teoh via Digitalmars-d-learn
- Re: Reserving ca... Jon D via Digitalmars-d-learn