by sgtnoodle · 5y ago · 0 comments
It also depends on how you can represent the string and their typical size. If the strings are small, then allocating fixed size chunks to store them inline might make sense. If the strings are long, it might make sense to go crazy and use a "trie" data structure to minimize comparisons.
I believe python uses hash maps for classes by default, but you can alternatively use "slots", which are less mutable and presumably more densely packed.