4 ms·
Why hashmaps? Python has named tuples. Oh - this puts a lot of keys into one hashmap, not a ton of objects with the same keys. :)
by benatkin 3y ago
Why hashmaps? Python has named tuples.
Oh - this puts a lot of keys into one hashmap, not a ton of objects with the same keys. :)
- murkt 3y agoPython also has dicts.
- benatkin 3y agoOf course. I was just saying that a lot of the time hashmaps don't get very many entries. There is serialization and deserialization where Cap'n Proto, Flatbuffers, and Protocol Buffers have a savings over JSON by not repeating key names of a list of maps.
- murkt 3y agoI fail to see how is this relevant to the article. HashMap/dict can as well store a mapping from an integer to an integer. Or from a token to an integer, or whatever, and it has nothing to do with serialization, JSON inefficiency or lists of maps.
- asplake 3y agoUse the structure that best fits the problem. The saving to which you refer applies only to serialisation, not to the use of the structure by an algorithm.