タグ

setに関するmogwaingのブックマーク (2)

  • 普通のset対unordered_set, 普通のアロケータ対boost.pool - 路傍のプログラマ

    set/unordered_setと普通のアロケータとboost.poolの組み合わせを比べてみたくなった。 ひょっとして変な相性問題とかあったりしないか?と心配になったので。 というわけで、ごそごそベンチマーク。 (テスト用コードは、Cryoliteさんのブログエントリ http://d.hatena.ne.jp/Cryolite/20061108 を参考にしました。この場を借りて、お礼申し上げます。) ソースコードは↓。コメントのところでset/unordered_set、allocator/fast_pool_allocatorを切り替えます。 ------------------------- #include <iostream> #include <set> #include <tr1/unordered_set> #include <tr1/functional> #incl

    普通のset対unordered_set, 普通のアロケータ対boost.pool - 路傍のプログラマ
    mogwaing
    mogwaing 2009/01/30
    set, unordered_set, unordered_set with boost::pool
  • unordered_setはどのくらい早いのか。

    unorderd_setの速度を調べるために、以下のコードを書いた。VC9で実行した結果、以下のようになった。 class std::set<unsigned int,struct std::less<unsigned int>,class std::allocator<unsigned int> > insert : 0.284398 find : 0.102093 class stdext::hash_set<unsigned int,class stdext::hash_compare<unsigned int,struct std::less<unsigned int> >,class std::allocator<unsigned int> > insert : 0.293333 find : 0.0481863 class boost::unordered_set<unsign

    mogwaing
    mogwaing 2009/01/30
    set, hash_set, unordered_set
  • 1