-
Notifications
You must be signed in to change notification settings - Fork 100
Optimization idea for subsetArray #291
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
Comments
We would not even need to write
|
Before we optimize this function, we should really setup a benchmark first to see if we are making progress. |
I think the Or would it also help with GC!? 🤔 |
I don't think the elements of the array can be garbage collected, since the hashmaps in which they are included are still reachable. It would be weird if a "subset" function would garbage collect something. |
Yes, but overwriting with |
#406 has implemented a version of this idea for unordered-containers/Data/HashMap/Internal.hs Lines 1870 to 1915 in d24cc1f
|
unordered-containers/Data/HashMap/Internal.hs
Lines 2197 to 2202 in 352591a
Once we've identified an element of
ary2
to correspond to an element ofary1
, it would be nice if we wouldn't check the same element again against the subsequent elements ofary1
.@treeowl had a neat idea for that in #282 (comment):
The text was updated successfully, but these errors were encountered: