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:
@@ -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 )
|
||||
|
||||
Reference in New Issue
Block a user