1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Don't recalculate histogram bins every frame.

This remedies slowdown that was only visible when a histogram of a large
number of zones (~100 million) was displayed. The slowdown was caused by
std::accumulate() calls over whole set of zones.
This commit is contained in:
Bartosz Taudul
2019-06-16 16:41:52 +02:00
parent 14398dd4e8
commit d683699ba9
2 changed files with 87 additions and 67 deletions
+8
View File
@@ -376,6 +376,13 @@ private:
int selCs = 0;
int minBinVal = 1;
struct
{
int numBins = -1;
ptrdiff_t distBegin;
ptrdiff_t distEnd;
} binCache;
void Reset()
{
ResetMatch();
@@ -411,6 +418,7 @@ private:
selAverage = 0;
selMedian = 0;
selTotal = 0;
binCache.numBins = -1;
}
void ShowZone( int32_t srcloc, const char* name )