Skip to content
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

LittleDict should overload hasfastin to be false #33

Open
oxinabox opened this issue Feb 5, 2020 · 2 comments
Open

LittleDict should overload hasfastin to be false #33

oxinabox opened this issue Feb 5, 2020 · 2 comments

Comments

@oxinabox
Copy link
Member

oxinabox commented Feb 5, 2020

This function says if the checking of haskey is expected logorithmic or better.
but for LittleDict it is not, it is linear.

Default for AbstractDict is true.

https://github.com/JuliaLang/julia/blob/aa36eefa17e68dd3781b668bc40328583b161924/base/abstractset.jl#L284-L295

@kmsquire
Copy link
Member

kmsquire commented Feb 5, 2020

Technically true, but isn’t the point of LittleDicts is that they’re used when you only have a few values? In this case, the size is bounded, and the timing can be considered linear. (Of course, there isn’t a size check in the code, right?)

Technical definitions aside, what is the point of hasfastin? If it’s really concerned about speed, then the speed of key lookup in LittleDicts might be considered fast. If it’s used for inlining (or something similar), then maybe not.

@oxinabox
Copy link
Member Author

oxinabox commented Feb 6, 2020

See discussion in JuliaLang/julia#34672

It's exactly the same here except we know more about the type of our key container -- always tuple or vevtor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants