How to work with hashmap from memutils properly?

Era Scarecrow rtcvb32 at yahoo.com
Fri Feb 11 21:22:16 UTC 2022


On Friday, 11 February 2022 at 02:43:24 UTC, Siarhei Siamashka 
wrote:
> Though this strange benchmark is testing performance of an LRU 
> with ... wait for it ... 10 elements, which makes using 
> hashmap/dict/AA a completely ridiculous idea.

  Hmmm... if it's static data i can see maybe a enum hashmap with 
keynames, and then it resolved at compile-time to fixed values 
maybe (*for AA*).

  I remember for a C project i faked a hashmap/AA by having sorted 
key/value pairs and then doing a binary lookup. I also have a D 
static-AA i made which will make an array large enough for all 
the statically known values at compile-time, though i don't know 
if anyone uses it.

  Regardless, 10 items really is a bad test size; Big enough to 
show it might be working but not big enough for performance tests 
(*at least with 2Ghz+ computers today; Maybe on a Pi where you 
can drop it to 30Mhz then you could get somewhat useful results 
from a smaller dataset*).




More information about the Digitalmars-d-learn mailing list