aboutsummaryrefslogtreecommitdiff
path: root/src/common/dwarf_cu_to_module.cc
diff options
context:
space:
mode:
authormark@chromium.org <mark@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e>2014-06-26 12:37:15 +0000
committermark@chromium.org <mark@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e>2014-06-26 12:37:15 +0000
commitada265ebbd74ce801aeda2af7359afdb99d73b58 (patch)
treeeca3aa6e2b6313a82c4537560ab7d679fd44f228 /src/common/dwarf_cu_to_module.cc
parentUpdate output for test minidump_dump_test. (diff)
downloadbreakpad-ada265ebbd74ce801aeda2af7359afdb99d73b58.tar.xz
dump_syms: use unordered_set<> instead of set<> for speed.
dump_syms spends a lot of time trying to compare strings. This change speeds up processing of libwebviewchromium.so by 30% on my linux machine. Patch by Junichi Uekawa <uekawa@chromium.org> Review URL: https://breakpad.appspot.com/2714002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1341 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/common/dwarf_cu_to_module.cc')
-rw-r--r--src/common/dwarf_cu_to_module.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/common/dwarf_cu_to_module.cc b/src/common/dwarf_cu_to_module.cc
index 1d157def..297e058d 100644
--- a/src/common/dwarf_cu_to_module.cc
+++ b/src/common/dwarf_cu_to_module.cc
@@ -46,7 +46,7 @@
#include <stdio.h>
#include <algorithm>
-#include <set>
+#include <tr1/unordered_set>
#include <utility>
#include "common/dwarf_line_to_module.h"
@@ -55,8 +55,8 @@ namespace google_breakpad {
using std::map;
using std::pair;
-using std::set;
using std::sort;
+using std::tr1::unordered_set;
using std::vector;
// Data provided by a DWARF specification DIE.
@@ -118,7 +118,7 @@ struct DwarfCUToModule::FilePrivate {
// so this set will actually hold yet another copy of the string (although
// everything will still work). To improve memory consumption portably,
// we will probably need to use pointers to strings held in this set.
- set<string> common_strings;
+ unordered_set<string> common_strings;
// A map from offsets of DIEs within the .debug_info section to
// Specifications describing those DIEs. Specification references can
@@ -337,7 +337,7 @@ void DwarfCUToModule::GenericDIEHandler::ProcessAttributeReference(
}
string DwarfCUToModule::GenericDIEHandler::AddStringToPool(const string &str) {
- pair<set<string>::iterator, bool> result =
+ pair<unordered_set<string>::iterator, bool> result =
cu_context_->file_context->file_private_->common_strings.insert(str);
return *result.first;
}