-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drop SimpleHash (Was: SimpleHash and other hashes) #2331
Comments
Sorry, hit close button on smartphone... |
At first we should drop SimpleHash, especially if it's inefficient and we don't want to maintain it. I'm all in favor for a fast Hash table by default (there are a bunch of papers on the subject), and maybe an OrderedHash that could be slower/use more memory but come handy at times. |
BTW on the topic of hashes: http://preshing.com/20160314/leapfrog-probing/ |
Wouldn't it be best to have Of course this would cause every call to methods on an instance created via Map.new to be branched I guess ( |
In the compiler we used to use SimpleHash (a hash built on top of an array of pairs) for some paths where the hash would end up with a few elements. However, we don't use that anymore because the performance difference was negligible.
The problem is, it's kind of public API now, and others want to use it, like here, but I'm not sure I want to stick with that type in the standard library. Or, if we stick with it, it's better if we change its name and clearly state its use case.
The questions are:
ArrayHash
would be an appropriate name, although it sounds confusing.Hash
has a doubly linked list that allows maintaining insertion sorter, but this needs more allocated memory to work, so not having this functionality will speed up things in some cases. If so, what name should we use? Or maybe we can swap things, and maybe Hash dumber and add a LinkedHash.The text was updated successfully, but these errors were encountered: