From ada265ebbd74ce801aeda2af7359afdb99d73b58 Mon Sep 17 00:00:00 2001 From: "mark@chromium.org" Date: Thu, 26 Jun 2014 12:37:15 +0000 Subject: 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 Review URL: https://breakpad.appspot.com/2714002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1341 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/common/dwarf_cu_to_module.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/common/dwarf_cu_to_module.cc') 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 #include -#include +#include #include #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 common_strings; + unordered_set 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::iterator, bool> result = + pair::iterator, bool> result = cu_context_->file_context->file_private_->common_strings.insert(str); return *result.first; } -- cgit v1.2.1