From 593ef5981d0336bbe745936b166cd24ec754cac4 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Wed, 31 Oct 2018 13:36:34 +0000 Subject: perf_timer: call reserve on new timer array to avoid reallocations in the vast majority of the time --- src/common/perf_timer.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/common') 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(); + performance_timers->reserve(16); // how deep before realloc } else { -- cgit v1.2.3