-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Base.hasfastin(Iterators.Pairs) needs to check how it is storing the keys #34672
Comments
I can also think of It would be great to have one (or more) benchmarks of the implication of changing this |
I think the idea is on does something like:
|
Precisely, so for small collections it might still be better to not create a |
example of use: Lines 274 to 280 in 3aeb3ec
|
Similar to JuliaCollections/OrderedCollections.jl#33
We see that:
hasfastin
if the checking ofhaskey
is expected logorithmic or better.but for for many uses of pairs, e.g. when applied to a
NamedTuple
it is linear.But we are falling back to the default for
AbstractDict
which istrue
.julia/base/abstractset.jl
Lines 284 to 295 in aa36eef
The text was updated successfully, but these errors were encountered: