You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi!
Getting to know the libraries while following TerraAcademy, I was wondering why hooks.rs is implemented as a Vec instead of an (allegedly more perfomant) HashMap. Any reasons I'm not seeing? If not, I'd be happy to reimplement :)
The text was updated successfully, but these errors were encountered:
HashMap is not serialisable with our json lib as ordering is not deterministic. Do not use it anywhere.
Also, since the process is "load struct from disk, deserialise, search", any performance gain HashMap would give would be offset by decreased performance of the deserialisation.
The other approach is to store in a cw_storage_plus::Map, but that uses a different key for every item, and is much more expensive if we always want to iterate over all items
Hi!
Getting to know the libraries while following TerraAcademy, I was wondering why hooks.rs is implemented as a
Vec
instead of an (allegedly more perfomant)HashMap
. Any reasons I'm not seeing? If not, I'd be happy to reimplement :)The text was updated successfully, but these errors were encountered: