perf_timer: call reserve on new timer array

to avoid reallocations in the vast majority of the time
This commit is contained in:
moneromooo-monero 2018-10-31 13:36:34 +00:00
parent 6ecc99ad1f
commit 593ef5981d
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3

View file

@ -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
{