Try converting ad-hoc msymbol hash tables to STL containers I went with multimap (also tried unordered_multimap) to keep the behavior where we have a special hash key and want to iterate over everything with that hash using specialized compare functions. Unfortunately this is a 10% regression. real 0m56.538s user 0m34.304s sys 0m22.380s real 0m51.655s user 0m32.194s sys 0m19.528s