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

Unboxed variants of hash tables #33

Open
dcoutts opened this issue May 11, 2016 · 2 comments
Open

Unboxed variants of hash tables #33

dcoutts opened this issue May 11, 2016 · 2 comments

Comments

@dcoutts
Copy link

dcoutts commented May 11, 2016

There are uses cases where compactness is quite important and we're working with unboxable types like Ints (or newtyped wrapped ints) where it'd be nice to have hash table that uses an unboxed vector for the keys and values. (These cases also tend to want inplace updates of the values, issue #6)

For such an application I hacked up the implementation to add a variant of Basic that uses unboxed vectors rather than boxed ones. I had to make some adjustments to the type class to allow this, but it doesn't affect the existing implementations too much. It just changes how we declare the instances, and it affects generic code in the IO wrapper.

So this is an RFC. In particular, @gregorycollins would you be interested in unboxed variants of the existing implementations? If so I can try and tidy up what I hacked up quickly and we can look at different ways to adjust the class to allow for both boxed and unboxed variants.

@jamesdbrock
Copy link

@dcoutts I also have a use case for unboxable types, and I'd like to look at your "hacked up implementation." Would you please push your branch to Github, or publish it somewhere?

@gregorycollins
Copy link
Owner

Unboxed versions would be fine! They would surely perform better than the current ones, which are hampered by single-threadedness in the garbage collector.

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

3 participants