Closed sourencho closed 4 years ago
Did some profiling with gperftools and found that TemporalMetric::getRate and TemporalMetric::getAverage are using a lot of CPU.
TemporalMetric::getRate
TemporalMetric::getAverage
Client running with those calls runs at 30% CPU Client running without runs at 99% CPU
Probably because of the way TemporalMetric::getAllCounts is flattening the vector of vectors. https://github.com/SourenP/ungroup_game/blob/0aa9da74245c0fd0f2298a7cfd475a54997e204b/src/common/metrics/TemporalMetric.cpp#L46-L52
TemporalMetric::getAllCounts
We can just return an iterator instead of creating a new flattened vector
Did some profiling with gperftools and found that
TemporalMetric::getRate
andTemporalMetric::getAverage
are using a lot of CPU.Client running with those calls runs at 30% CPU Client running without runs at 99% CPU
Probably because of the way
TemporalMetric::getAllCounts
is flattening the vector of vectors. https://github.com/SourenP/ungroup_game/blob/0aa9da74245c0fd0f2298a7cfd475a54997e204b/src/common/metrics/TemporalMetric.cpp#L46-L52