Reserving/Preallocating associative array?

Benjamin Thaut code at benjamin-thaut.de
Mon Dec 30 08:09:59 PST 2013


Am 30.12.2013 15:06, schrieb Daniel Kozak:
>
> This is cool!
>
> Can you post somewhere your code and data which you use for this test? I
> really like to test it on my new AA implementation :)

Here is the post that describes how to get the data: 
http://forum.dlang.org/post/yglwnmawrvbhpszdsiqs@forum.dlang.org

And here the post how to convert it to tabular text data:
http://forum.dlang.org/post/rhyycuwlxsoqbtpzpgzd@forum.dlang.org

After dumping the "relationship" table from mysql I just removed the 
first column because it only contains the ID of the entry. I then used 
the remaining two columns for profiling. You will have to get the data 
yourself, as I can't repost it here (because its not my data).

Here is the post that describes my implementation:
http://forum.dlang.org/post/l9kcm2$2i4i$1@digitalmars.com

For profiling the lookups, I generated 100_000 random numbers in the 
range range (0, 200_000] and saved them to a file. I then profile the 
lookup of those 100_000 random numbers. Out of all these numbers rughly 
75% are valid indices and the rest are invalid indices to profile both 
the lookup of valid and invalid keys.

For profiling your implementation I just used the code you posted.

Kind Regards
Benjamin Thaut


More information about the Digitalmars-d mailing list