summaryrefslogtreecommitdiff
path: root/src/mongo/util/string_map_test.cpp
diff options
context:
space:
mode:
authorAndrew Morrow <acm@10gen.com>2013-08-21 13:15:03 -0400
committerAndrew Morrow <acm@10gen.com>2013-08-21 13:21:08 -0400
commita02c3c2f20610bee93fd68cad2324cccc629e2ff (patch)
treef3c47c8c2b8e9f083f72677f57b5877bfaf3e02e /src/mongo/util/string_map_test.cpp
parent252f42781db4b1019433968b7293287d18b2ec40 (diff)
downloadmongo-a02c3c2f20610bee93fd68cad2324cccc629e2ff.tar.gz
SERVER-10555 Remove nondeterministic StringMap perf test from unit tests
Diffstat (limited to 'src/mongo/util/string_map_test.cpp')
-rw-r--r--src/mongo/util/string_map_test.cpp42
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
}