opened
ndmitchell
username_0
Two interesting things. 1) Simon Peyton Jones remarks that the Hashable instance for Value could hash only the value, not the type as well. 2) how often do we get collisions in the map? Would be an interesting statistic in diagnostic mode. Could also check all keys are equal to themselves in lint.
Think about hash keys
issue
created
ndmitchell
username_0
Johan says taking hashes from multiple types and combining them directly is a bad idea, so I won't do (1).
comment
created
ndmitchell
username_0
Probably the easiest thing is to add the info to the profile output, and then analyse it there.
comment
created
ndmitchell
username_0
So plan is to write the hash for each key in the JSON, then in the viewer have a collision percentage and a max hash collisions, so people can drill down if there is an issue.
comment
created
ndmitchell
username_0
It's unclear if duplicate hash collisions would actually have a meaningful impact on the database. Most of the time I'm using an array and indexing by `Id` so these things don't crop up much.

At the same time, I thought it worth confirming that Hadrian doesn't have too many duplicate keys. Out of 15,810 keys, it has no duplicates at all. This really isn't worth bubbling up to the profiling.
comment
closed
ndmitchell
username_0
issue