perf_timer: call reserve on new timer array

to avoid reallocations in the vast majority of the time
release-v0.5.0
moneromooo-monero 6 years ago
parent 6ecc99ad1f
commit 593ef5981d
No known key found for this signature in database
GPG Key ID: 686F07454D6CEFC3

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

Loading…
Cancel
Save