Am 14.05.2014 12:33, schrieb Chris:
On Wednesday, 14 May 2014 at 10:20:51 UTC, bearophile wrote:
Chris:

Is there any huge difference as regards performance and memory
footprint between the two? Or is 2. basically 1. under the
hood?

An associative array is a rather more complex data structure,
so if you don't need it, use something simpler. There is
difference in both the amount of memory used and performance
(in many cases such difference doesn't matter). In D there are
also differences in the way they are initialized from a null or
fat null.

Bye,
bearophile

Thanks. Do you mean the difference is negligible in many cases?
I'm not sure, because changing it would be a breaking change in
the old code, meaning I would have to change various methods.

a simple array would be faster because no access is generate for your key - just plain access, just don't use assoc arrays if you don't need key based access

read more manuals about hashmaps and stuff and how to do benchmarking - helps alot in the future


Reply via email to