About built-in AAs

Walter Bright newshound2 at digitalmars.com
Wed Aug 17 14:06:09 PDT 2011


On 8/17/2011 11:33 AM, bearophile wrote:
> Andrei Alexandrescu:
>
>> Let's please stop this.
>
> OK, but I'd like to note that what I have written comes from some experiments too:
> http://is.gd/L4U3Kp

I don't think it's a sensible point of view. If you supply your own hash 
function, the onus is on you to produce a suitable one. It is not the languages' 
fault if the hash tables run poorly if your hash function always returns the 
same value.

Secondly, I seriously doubt this is any sort of viable "attack" vector. If you 
are allowing users to write system code (which D is) and remotely run it on your 
system, a slow hash map is the least of your security concerns. Heck, you could 
just write for(;;){} and call it a day. Nothing clever required.

And, the linear version is much FASTER and uses significantly LESS memory in 
real world situations, which is why we switched to it.

Bottom line, I don't think there's an actual problem here.


More information about the Digitalmars-d mailing list