summaryrefslogtreecommitdiffstats
path: root/base/location.cc
diff options
context:
space:
mode:
authorsque <sque@chromium.org>2015-03-13 19:39:03 -0700
committerCommit bot <commit-bot@chromium.org>2015-03-14 02:39:57 +0000
commite3b16f181ab489621ca9866f472e012e33b6e9c0 (patch)
tree5f077bb669f0939ae4dfa2c899da8fba734f4851 /base/location.cc
parent5ba8aa856919269a1a079c376d70480da0c2fc23 (diff)
downloadchromium_src-e3b16f181ab489621ca9866f472e012e33b6e9c0.zip
chromium_src-e3b16f181ab489621ca9866f472e012e33b6e9c0.tar.gz
chromium_src-e3b16f181ab489621ca9866f472e012e33b6e9c0.tar.bz2
Use hash map for tracked_objects::location
Accessing the Location->Birth std::map takes up about 0.5% of the CPU cycles, according to recent data from ChromeOS-wide profiling. That is a LOT for Chrome, which contains a ton of stuff. Replacing it with a hash map cuts that down by 1/3 to 1/2. See the bug for more details. BUG=chromium:463700 Signed-off-by: Simon Que <sque@chromium.org> Review URL: https://codereview.chromium.org/957573002 Cr-Commit-Position: refs/heads/master@{#320635}
Diffstat (limited to 'base/location.cc')
-rw-r--r--base/location.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/base/location.cc b/base/location.cc
index 8b32b97..1333e6e 100644
--- a/base/location.cc
+++ b/base/location.cc
@@ -31,6 +31,13 @@ Location::Location()
program_counter_(NULL) {
}
+Location::Location(const Location& other)
+ : function_name_(other.function_name_),
+ file_name_(other.file_name_),
+ line_number_(other.line_number_),
+ program_counter_(other.program_counter_) {
+}
+
std::string Location::ToString() const {
return std::string(function_name_) + "@" + file_name_ + ":" +
base::IntToString(line_number_);