mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Pack StringIdx in 24 bits.
This reduces ZoneEvent size from 32 to 30 bytes. Memory usage reduction on selected traces (sizes in MB): big 9902 -> 9527 (96%) chicken 2172 -> 2107 (97%) ctx-big 311 -> 309 (99%) drl-l-b 1570 -> 1479 (94%) long 5496 -> 5412 (98%) mem 6468 -> 6468 (100%) q3bsp-mt 5784 -> 5592 (96%) selfprofile 1486 -> 1443 (97%)
This commit is contained in:
@@ -130,8 +130,8 @@ private:
|
||||
{
|
||||
const auto& v = data->data[i];
|
||||
hash = ( ( hash << 5 ) + hash ) ^ size_t( v.line );
|
||||
hash = ( ( hash << 5 ) + hash ) ^ size_t( v.file.__data );
|
||||
hash = ( ( hash << 5 ) + hash ) ^ size_t( v.name.__data );
|
||||
hash = ( ( hash << 5 ) + hash ) ^ size_t( v.file.Idx() );
|
||||
hash = ( ( hash << 5 ) + hash ) ^ size_t( v.name.Idx() );
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
@@ -517,7 +517,7 @@ private:
|
||||
|
||||
tracy_force_inline void ReadTimeline( FileRead& f, ZoneEvent* zone, uint16_t thread, int64_t& refTime );
|
||||
tracy_force_inline void ReadTimelinePre042( FileRead& f, ZoneEvent* zone, uint16_t thread, int fileVer );
|
||||
tracy_force_inline void ReadTimelinePre052( FileRead& f, ZoneEvent* zone, uint16_t thread, int64_t& refTime, int fileVer );
|
||||
tracy_force_inline void ReadTimelinePre058( FileRead& f, ZoneEvent* zone, uint16_t thread, int64_t& refTime, int fileVer );
|
||||
tracy_force_inline void ReadTimeline( FileRead& f, GpuEvent* zone, int64_t& refTime, int64_t& refGpuTime );
|
||||
tracy_force_inline void ReadTimelinePre052( FileRead& f, GpuEvent* zone, int64_t& refTime, int64_t& refGpuTime, int fileVer );
|
||||
|
||||
@@ -525,7 +525,7 @@ private:
|
||||
|
||||
void ReadTimeline( FileRead& f, Vector<ZoneEvent*>& vec, uint16_t thread, uint64_t size, int64_t& refTime );
|
||||
void ReadTimelinePre042( FileRead& f, Vector<ZoneEvent*>& vec, uint16_t thread, uint64_t size, int fileVer );
|
||||
void ReadTimelinePre052( FileRead& f, Vector<ZoneEvent*>& vec, uint16_t thread, uint64_t size, int64_t& refTime, int fileVer );
|
||||
void ReadTimelinePre058( FileRead& f, Vector<ZoneEvent*>& vec, uint16_t thread, uint64_t size, int64_t& refTime, int fileVer );
|
||||
void ReadTimeline( FileRead& f, Vector<GpuEvent*>& vec, uint64_t size, int64_t& refTime, int64_t& refGpuTime );
|
||||
void ReadTimelinePre052( FileRead& f, Vector<GpuEvent*>& vec, uint64_t size, int64_t& refTime, int64_t& refGpuTime, int fileVer );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user