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

Non-string map keys #6991

Closed
medvednikov opened this issue Nov 28, 2020 · 9 comments
Closed

Non-string map keys #6991

medvednikov opened this issue Nov 28, 2020 · 9 comments
Assignees
Labels
Bug This tag is applied to issues which reports bugs.

Comments

@medvednikov
Copy link
Member

No description provided.

@ntrel
Copy link
Contributor

ntrel commented Nov 28, 2020

I'm interested in working on this, anyone else? I think the key type would need a hash method and* an equals function. (For autofree also an optional clone method).

* actually the general-purpose hash is probably enough.

@medvednikov
Copy link
Member Author

@ntrel good luck!

@ka-weihe can give some hints and answer questions about the implementation.

@ka-weihe
Copy link
Member

@ka-weihe can give some hints and answer questions about the implementation.

For sure. @ntrel feel free to contact me on discord (I'm "Kasper W" on V's discord).

@dumblob
Copy link
Contributor

dumblob commented Nov 30, 2020

Beware non-string maps will amplify the undefined behavior of equals() for floats.

@ntrel ntrel self-assigned this Dec 1, 2020
@ntrel
Copy link
Contributor

ntrel commented Dec 1, 2020

I'm working on making DenseArray support non-string keys first, with map still using string keys. When that's done I can make a pull request.

I've spoken to @ka-weihe on Discord and he suggested a good optimization when there are no deleted keys, so my work will be compatible with that.

@dumblob
Copy link
Contributor

dumblob commented Dec 1, 2020

I've spoken to @ka-weihe on Discord and he suggested a good optimization when there are no deleted keys, so my work will be compatible with that.

Speaking of optimization, the check for existence in a "static" map (if x in mymap_with_just_unconditional_values_added) or array (if x in [ 'a', 'b', 'c' ]) can be "extremely" optimized by using optimal hashing.

@ka-weihe
Copy link
Member

ka-weihe commented Dec 1, 2020

@dumblob that is correct and I think we will eventually do that optimization along with a huge list of other optimizations, but right now the focus is strictly on non-string keys 🙂

@ntrel
Copy link
Contributor

ntrel commented Dec 14, 2020

DenseArray is now string-free. I'm working on encapsulating the other operations on a key with functions taking voidptr.

@danieldaeschle
Copy link
Member

This has been implemented afaik

@medvednikov medvednikov added the Bug This tag is applied to issues which reports bugs. label Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs.
Projects
None yet
Development

No branches or pull requests

5 participants