New hash

H. S. Teoh hsteoh at quickfur.ath.cx
Fri Mar 23 21:58:44 PDT 2012


On Sat, Mar 24, 2012 at 05:47:55AM +0100, Andrej Mitrovic wrote:
[...]
> I've managed to test the hashes on a small-sized closed-source project
> (9K lines) which used hashes a lot. I've found no issues so far (no
> memory corruption or anything). Performance did drop a bit from
> 812msecs to 898msecs. I can't extensively test this yet because I
> can't serialize the hashes (a serialization library doesn't want to
> work with the new hashes but I'll fix that) and so I need a 30second
> run that first fills the hashes before doing work on them. But it does
> seem to be a tiny bit slower.

OK, good to know. I thought I've weeded out the inefficient parts of the
code, but I guess one never knows until you run a profiler on it.

Note that if hash literals are used, then they can be inefficient
because of the current hack of copying from the current AA (so it will
involve two copies: one from the compiler's native array-of-keys and
array-of-values representation, another from the current AA to the new
AA).


T

-- 
Don't modify spaghetti code unless you can eat the consequences.


More information about the Digitalmars-d mailing list