-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Added a dedicated HandleMap #5418
Conversation
f56c42e
to
dc43ce8
Compare
Controversial label for now until we can find some clear use cases :) Cool stuff though! |
This would be useful for #5080. Given it relies on a |
All these other uses will probably also benefit from the
|
I use this in my games (it's nice to create a simple library of assets to load), but I'm 100% fine to just stay with a plain |
@alice-i-cecile I think I can add storing strong handles. I will make that change and report back the performance difference. |
1 similar comment
@alice-i-cecile I think I can add storing strong handles. I will make that change and report back the performance difference. |
dc43ce8
to
a296a96
Compare
a296a96
to
509cdc8
Compare
@alice-i-cecile This adds the ability to store strong handles. New benchmark:
|
3c97c77
to
09862fc
Compare
Backlog cleanup: closing due to inactivity. Unlikely to benefit from a tracking issue here, on balance. |
This version is nowhere ready to merge. I am mostly looking for people's opinion. Idk if I missed something obvious in the benchmark.
Objective
Add a
HandleMap<K, V>
to replaceHashMap<Handle<K>, V>
. Its goal is to increase performance by reducing the amount of data that needs to be hashed to access a value in a hash map.A limitation of the current implementation of
HandleMap<K, V>
is that it can't store a strong handle whereasHashMap<Handle<K>, V>
can. I don't know how often this capability is required.Bench
Time taken to call .get 1,000,000 times:
HandleId::Id
/ Total IDsHashMap<Handle<K>, V>
HandleMap<K, V>