持橋さんの書かれたgoogle-sparsehashと自作のsplay-treeとの速度比較をした結果の記事を読んで、さすがに速度に200倍近くの差がでるのはおかしいだろうということで原因を探ってみた。 結論としてはGoogle Sparsehashを使うときに__gnu_cxx::hashを使わない方がよいということが分かった。 時間の測定に用いられているコードは概ね以下のコードと同じである。 #include <iostream> #include <google/sparse_hash_map> #include <cstdio> #include <cstring> #include <ext/hash_map> using namespace std; using google::sparse_hash_map; typedef __gnu_cxx::hash<const cha