Associative Arrays need cleanout method or property to help
Michael Rynn
michaelrynn at optusnet.com.au
Tue Mar 23 05:51:24 PDT 2010
On Mon, 22 Mar 2010 00:52:24 -0700, Walter Bright wrote:
> bearophile wrote:
>> A way to know the usage patterns of D AAs is to add instrumentation in
>> nonrelease mode, they can save few statistical data once in a while in
>> the install directory of D, and then the user can give this little txt
>> file to Walter to tune the language :-)
>
> There's no need to tune the language. The implementation and data
> structure of the AAs is completely opaque to the language. The
> implementation is in aaA.d. Feel free to try different implementations
> in it!
Well, I have.
See the code here : http://www.dsource.org/projects/aa/browser/trunk/
druntime/aaA.d
See the benchmarks and comments here : http://www.dsource.org/projects/aa/
wiki/DrunTimeAA.
The result squeezes some extra performance for integer or less sized keys
(about 20% faster for lookups).
Insertions and cleanups are faster too.
-- taf
Michael Rynn.
More information about the Digitalmars-d
mailing list