diff options
| author | Apollon Oikonomopoulos <apoikos@debian.org> | 2016-01-14 00:10:06 +0200 |
|---|---|---|
| committer | Apollon Oikonomopoulos <apollon@skroutz.gr> | 2016-01-14 00:10:06 +0200 |
| commit | 374e1947abcd3e127a2a613aff73ecffdb9199ea (patch) | |
| tree | d83973c3c9802450acd5b5e86fe0d4e8e60a3a1b /src/mongo/util/string_map_test.cpp | |
| parent | 65585c90b12d6523bea75a2aebaae2a2fdf9e641 (diff) | |
Imported Upstream version 2.6.11upstream/2.6.11
Diffstat (limited to 'src/mongo/util/string_map_test.cpp')
| -rw-r--r-- | src/mongo/util/string_map_test.cpp | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/src/mongo/util/string_map_test.cpp b/src/mongo/util/string_map_test.cpp index 41b5405085f..22c77542858 100644 --- a/src/mongo/util/string_map_test.cpp +++ b/src/mongo/util/string_map_test.cpp @@ -170,46 +170,4 @@ namespace { y = m; ASSERT_EQUALS( 5, y["eliot"] ); } - - template<typename M> - unsigned long long test_perf( M& m ) { - Timer t; - - PseudoRandom r(17); - char buf[64]; - for ( int i = 0; i< 100000; i++ ) { - sprintf( buf, "%dfoo%d", r.nextInt32(), r.nextInt32() ); - m[buf] = i; - ASSERT_EQUALS( i, m[buf] ); - } - - return t.micros(); - } - -#if !defined(_DEBUG) - TEST( StringMapTest, perf1 ) { - unsigned long long standard = 0; - unsigned long long unordered = 0; - unsigned long long custom = 0; - for ( int i = 0; i < 5; i++ ) { - { - std::map<string,int> m; - standard += test_perf( m ); - } - { - unordered_map<string,int> m; - unordered += test_perf( m ); - } - { - StringMap<int> m; - custom += test_perf( m ); - } - } - - log() << "std::map :\t" << standard << std::endl; - log() << "unordered:\t" << unordered << std::endl; - log() << "StringMap:\t" << custom << std::endl; - ASSERT_LESS_THAN( custom, standard ); - } -#endif } |
