Force inline fast check.

This commit is contained in:
Bartosz Taudul
2026-05-17 16:06:56 +02:00
parent 4c6157d249
commit f0f579172b
2 changed files with 20 additions and 13 deletions

View File

@@ -8974,13 +8974,8 @@ bool Worker::IsFrameExternal( StringIdx filename, StringIdx image ) const
return IsFrameExternalImpl( GetString( filename ), image.Active() ? GetString( image ) : nullptr );
}
bool Worker::IsImageExternal( StringIdx image, unordered_flat_map<uint32_t, bool>& cache, uint32_t& last ) const
bool Worker::IsImageExternalBody( StringIdx image, uint32_t key, unordered_flat_map<uint32_t, bool>& cache, uint32_t& last ) const
{
assert( image.Active() );
const auto key = image.Raw();
if( ( last & 0x00FFFFFF ) == key ) return last >> 24;
auto it = cache.find( key );
if( it != cache.end() )
{
@@ -8995,12 +8990,8 @@ bool Worker::IsImageExternal( StringIdx image, unordered_flat_map<uint32_t, bool
return res;
}
bool Worker::IsSourceExternal( StringIdx filename, unordered_flat_map<uint32_t, bool>& cache, uint32_t& last ) const
bool Worker::IsSourceExternalBody( StringIdx filename, uint32_t key, unordered_flat_map<uint32_t, bool>& cache, uint32_t& last ) const
{
const auto key = filename.Raw();
if( ( last & 0x00FFFFFF ) == key ) return last >> 24;
auto it = cache.find( key );
if( it != cache.end() )
{

View File

@@ -704,8 +704,21 @@ public:
void CacheSourceFiles();
bool IsFrameExternal( StringIdx filename, StringIdx image ) const;
bool IsImageExternal( StringIdx image, unordered_flat_map<uint32_t, bool>& cache, uint32_t& last ) const;
bool IsSourceExternal( StringIdx filename, unordered_flat_map<uint32_t, bool>& cache, uint32_t& last ) const;
tracy_force_inline bool IsImageExternal( StringIdx image, unordered_flat_map<uint32_t, bool>& cache, uint32_t& last ) const
{
assert( image.Active() );
const auto key = image.Raw();
if( ( last & 0x00FFFFFF ) == key ) return last >> 24;
return IsImageExternalBody( image, key, cache, last );
}
tracy_force_inline bool IsSourceExternal( StringIdx filename, unordered_flat_map<uint32_t, bool>& cache, uint32_t& last ) const
{
const auto key = filename.Raw();
if( ( last & 0x00FFFFFF ) == key ) return last >> 24;
return IsSourceExternalBody( filename, key, cache, last );
}
StringLocation StoreString( const char* str, size_t sz );
@@ -1001,6 +1014,9 @@ private:
int64_t GetZoneEndImpl( const ZoneEvent& ev ) const;
int64_t GetZoneEndImpl( const GpuEvent& ev ) const;
bool IsImageExternalBody( StringIdx image, uint32_t key, unordered_flat_map<uint32_t, bool>& cache, uint32_t& last ) const;
bool IsSourceExternalBody( StringIdx filename, uint32_t key,unordered_flat_map<uint32_t, bool>& cache, uint32_t& last ) const;
void UpdateMbps( int64_t td );
int64_t ReadTimeline( FileRead& f, Vector<short_ptr<ZoneEvent>>& vec, uint32_t size, int64_t refTime, int32_t& childIdx );