aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-10-31 13:36:34 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-11-01 15:51:22 +0000
commit593ef5981d0336bbe745936b166cd24ec754cac4 (patch)
treee70da2a38348701cc83666aa820da2689e9fa16b
parentcore: avoid unnecessary tx/blob conversions (diff)
downloadmonero-593ef5981d0336bbe745936b166cd24ec754cac4.tar.xz
perf_timer: call reserve on new timer array
to avoid reallocations in the vast majority of the time
-rw-r--r--src/common/perf_timer.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/common/perf_timer.cpp b/src/common/perf_timer.cpp
index 6910ebdd4..c5503416f 100644
--- a/src/common/perf_timer.cpp
+++ b/src/common/perf_timer.cpp
@@ -110,6 +110,7 @@ LoggingPerformanceTimer::LoggingPerformanceTimer(const std::string &s, uint64_t
{
MLOG(level, "PERF ----------");
performance_timers = new std::vector<LoggingPerformanceTimer*>();
+ performance_timers->reserve(16); // how deep before realloc
}
else
{