mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Store source location in a single object.
Source file, function name and line number are now stored in a const static container object. This has the following benefits: - Slightly lighter profiling workload (3 instructions less). - Profiling queue event size is significantly reduced, by 12 bytes. This has an effect on all queue event types. - Source location grouping has now no cost, as it's performed at the compilation stage. This allows simplification of server code. The downside is that the full source location resolution is now performed in two steps, as the server has to query both source location container and strings contained within. This has almost no real impact on profiler operation.
This commit is contained in:
@@ -12,8 +12,8 @@ namespace tracy
|
||||
class ScopedZone
|
||||
{
|
||||
public:
|
||||
ScopedZone( const char* file, const char* function, uint32_t line, uint32_t color )
|
||||
: m_id( Profiler::ZoneBegin( QueueZoneBegin { Profiler::GetTime(), (uint64_t)file, (uint64_t)function, line, GetThreadHandle(), color } ) )
|
||||
ScopedZone( const SourceLocation* srcloc, uint32_t color )
|
||||
: m_id( Profiler::ZoneBegin( QueueZoneBegin { Profiler::GetTime(), (uint64_t)srcloc, GetThreadHandle(), color } ) )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user