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

Reduce data collection if TRACY_NO_STATISTICS is defined.

Statistical data collection is only useful if it's meant to be used.
Otherwise it only incurs CPU and memory cost.
This commit is contained in:
Bartosz Taudul
2018-03-18 12:55:54 +01:00
parent 4baea4a74f
commit 7a4e7cbf86
4 changed files with 25 additions and 0 deletions
+4
View File
@@ -54,7 +54,9 @@ class Worker
Vector<SourceLocation*> sourceLocationPayload;
flat_hash_map<SourceLocation*, uint32_t, SourceLocationHasher, SourceLocationComparator> sourceLocationPayloadMap;
Vector<uint64_t> sourceLocationExpand;
#ifndef TRACY_NO_STATISTICS
flat_hash_map<int32_t, Vector<ZoneEvent*>, nohash<int32_t>> sourceLocationZones;
#endif
std::map<uint32_t, LockMap> lockMap;
};
@@ -110,7 +112,9 @@ public:
const SourceLocation& GetSourceLocation( int32_t srcloc ) const;
std::vector<int32_t> GetMatchingSourceLocation( const char* query ) const;
#ifndef TRACY_NO_STATISTICS
const Vector<ZoneEvent*>& GetZonesForSourceLocation( int32_t srcloc ) const;
#endif
NonRecursiveBenaphore& GetMbpsDataLock() { return m_mbpsData.lock; }
const std::vector<float>& GetMbpsData() const { return m_mbpsData.mbps; }