mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Cache bin containers in find zone.
This commit is contained in:
parent
2950f3c70c
commit
da5d35c364
@ -3425,13 +3425,20 @@ void View::DrawFindZone()
|
|||||||
const auto numBins = int64_t( w - 4 );
|
const auto numBins = int64_t( w - 4 );
|
||||||
if( numBins > 1 )
|
if( numBins > 1 )
|
||||||
{
|
{
|
||||||
auto bins = std::make_unique<int64_t[]>( numBins );
|
if( numBins != m_findZone.numBins )
|
||||||
|
{
|
||||||
|
m_findZone.numBins = numBins;
|
||||||
|
m_findZone.bins = std::make_unique<int64_t[]>( numBins );
|
||||||
|
m_findZone.binTime = std::make_unique<int64_t[]>( numBins );
|
||||||
|
m_findZone.selBin = std::make_unique<int64_t[]>( numBins );
|
||||||
|
}
|
||||||
|
|
||||||
|
const auto& bins = m_findZone.bins;
|
||||||
|
const auto& binTime = m_findZone.binTime;
|
||||||
|
const auto& selBin = m_findZone.selBin;
|
||||||
|
|
||||||
memset( bins.get(), 0, sizeof( int64_t ) * numBins );
|
memset( bins.get(), 0, sizeof( int64_t ) * numBins );
|
||||||
|
|
||||||
auto binTime = std::make_unique<int64_t[]>( numBins );
|
|
||||||
memset( binTime.get(), 0, sizeof( int64_t ) * numBins );
|
memset( binTime.get(), 0, sizeof( int64_t ) * numBins );
|
||||||
|
|
||||||
auto selBin = std::make_unique<int64_t[]>( numBins );
|
|
||||||
memset( selBin.get(), 0, sizeof( int64_t ) * numBins );
|
memset( selBin.get(), 0, sizeof( int64_t ) * numBins );
|
||||||
|
|
||||||
int64_t selBinTime = 0;
|
int64_t selBinTime = 0;
|
||||||
|
|||||||
@ -211,6 +211,8 @@ private:
|
|||||||
bool showThreads = true;
|
bool showThreads = true;
|
||||||
bool sortByCounts = false;
|
bool sortByCounts = false;
|
||||||
Region highlight;
|
Region highlight;
|
||||||
|
int64_t numBins = -1;
|
||||||
|
std::unique_ptr<int64_t[]> bins, binTime, selBin;
|
||||||
|
|
||||||
void Reset()
|
void Reset()
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user