3 ms·
STL maps are pretty slow and can be beat without too much effort.
by adrianN 10y ago
STL maps are pretty slow and can be beat without too much effort.
- tom_mellior 10y agoYou mean with hash tables? Different underlying structure, so I wouldn't call that a reimplementation. Anyway, the projects I mention above also define their own vectors.
- lorenzhs 10y agoeven std::unordered_map is easy to beat on most workloads if you relax the standard's requirements a litte, because the standard more or less requires hashing with chaining ("The elements of an unordered associative container are organized into buckets. Keys with the same hash code appear in the same bucket"). A good linear probing hash table will be faster most of the time, e.g. Google's dense_hash_map.