Store zone children counts as uint32, not uint64.

This, along with the previous change has the following effect on trace
file sizes:

old/0.tracy (0.6.2) {6512 KB} -> new/0.tracy (0.6.3) {6518 KB}  100.10% size change
old/android.tracy (0.6.2) {488901 KB} -> new/android.tracy (0.6.3) {489710 KB}  100.17% size change
old/android-vk.tracy (0.6.2) {78049 KB} -> new/android-vk.tracy (0.6.3) {76570 KB}  98.10% size change
old/asset-new.tracy (0.6.2) {74224 KB} -> new/asset-new.tracy (0.6.3) {74181 KB}  99.94% size change
old/asset-new-id.tracy (0.6.2) {79900 KB} -> new/asset-new-id.tracy (0.6.3) {79875 KB}  99.97% size change
old/asset-old.tracy (0.6.2) {76245 KB} -> new/asset-old.tracy (0.6.3) {76420 KB}  100.23% size change
old/big.tracy (0.6.2) {922594 KB} -> new/big.tracy (0.6.3) {860068 KB}  93.22% size change
old/big2.tracy (0.6.2) {2028646 KB} -> new/big2.tracy (0.6.3) {1990121 KB}  98.10% size change
old/callstack.tracy (0.6.2) {14343 KB} -> new/callstack.tracy (0.6.3) {17707 KB}  123.45% size change
old/callstack-bsd.tracy (0.6.2) {14551 KB} -> new/callstack-bsd.tracy (0.6.3) {12652 KB}  86.94% size change
old/callstack-linux.tracy (0.6.2) {6953 KB} -> new/callstack-linux.tracy (0.6.3) {7012 KB}  100.86% size change
old/callstack-lua.tracy (0.6.2) {20439 KB} -> new/callstack-lua.tracy (0.6.3) {25889 KB}  126.66% size change
old/chicken.tracy (0.6.2) {311549 KB} -> new/chicken.tracy (0.6.3) {293828 KB}  94.31% size change
old/color.tracy (0.6.2) {865 KB} -> new/color.tracy (0.6.3) {866 KB}  100.13% size change
old/crash.tracy (0.6.2) {130 KB} -> new/crash.tracy (0.6.3) {130 KB}  99.85% size change
old/crash2.tracy (0.6.2) {1403 KB} -> new/crash2.tracy (0.6.3) {1327 KB}  94.56% size change
old/ctx.tracy (0.6.2) {3207 KB} -> new/ctx.tracy (0.6.3) {3203 KB}  99.89% size change
old/ctx-android.tracy (0.6.2) {88240 KB} -> new/ctx-android.tracy (0.6.3) {86209 KB}  97.70% size change
old/ctx-big.tracy (0.6.2) {88702 KB} -> new/ctx-big.tracy (0.6.3) {87038 KB}  98.12% size change
old/darkrl.tracy (0.6.2) {15458 KB} -> new/darkrl.tracy (0.6.3) {14560 KB}  94.19% size change
old/darkrl2.tracy (0.6.2) {7824 KB} -> new/darkrl2.tracy (0.6.3) {7435 KB}  95.02% size change
old/darkrl-light-big.tracy (0.6.2) {259652 KB} -> new/darkrl-light-big.tracy (0.6.3) {234625 KB}  90.36% size change
old/darkrl-old.tracy (0.6.2) {66299 KB} -> new/darkrl-old.tracy (0.6.3) {61883 KB}  93.34% size change
old/dxtc-bad.tracy (0.6.2) {7078 KB} -> new/dxtc-bad.tracy (0.6.3) {7048 KB}  99.57% size change
old/frameimages.tracy (0.6.2) {206425 KB} -> new/frameimages.tracy (0.6.3) {203537 KB}  98.60% size change
old/frameimages-big.tracy (0.6.2) {1177638 KB} -> new/frameimages-big.tracy (0.6.3) {1150496 KB}  97.70% size change
old/gn-opengl.tracy (0.6.2) {28587 KB} -> new/gn-opengl.tracy (0.6.3) {27355 KB}  95.69% size change
old/gn-vulkan.tracy (0.6.2) {28553 KB} -> new/gn-vulkan.tracy (0.6.3) {27050 KB}  94.74% size change
old/long.tracy (0.6.2) {1152078 KB} -> new/long.tracy (0.6.3) {1124731 KB}  97.63% size change
old/mem.tracy (0.6.2) {1187810 KB} -> new/mem.tracy (0.6.3) {1187668 KB}  99.99% size change
old/messages-callstack.tracy (0.6.2) {8743 KB} -> new/messages-callstack.tracy (0.6.3) {8608 KB}  98.46% size change
old/multi.tracy (0.6.2) {7735 KB} -> new/multi.tracy (0.6.3) {7304 KB}  94.43% size change
old/new.tracy (0.6.2) {1101 KB} -> new/new.tracy (0.6.3) {1076 KB}  97.79% size change
old/q3bsp-mt.tracy (0.6.2) {912230 KB} -> new/q3bsp-mt.tracy (0.6.3) {849329 KB}  93.10% size change
old/q3bsp-st.tracy (0.6.2) {227162 KB} -> new/q3bsp-st.tracy (0.6.3) {221594 KB}  97.55% size change
old/raytracer.tracy (0.6.2) {1105411 KB} -> new/raytracer.tracy (0.6.3) {977307 KB}  88.41% size change
old/selfprofile.tracy (0.6.2) {196894 KB} -> new/selfprofile.tracy (0.6.3) {184351 KB}  93.63% size change
old/tbrowser.tracy (0.6.2) {8776 KB} -> new/tbrowser.tracy (0.6.3) {7997 KB}  91.13% size change
old/test.tracy (0.6.2) {40498 KB} -> new/test.tracy (0.6.3) {39751 KB}  98.15% size change
old/topology.tracy (0.6.2) {3733 KB} -> new/topology.tracy (0.6.3) {3739 KB}  100.16% size change
old/topology-android.tracy (0.6.2) {5292 KB} -> new/topology-android.tracy (0.6.3) {5177 KB}  97.82% size change
old/tracy-dynamic.tracy (0.6.2) {672684 KB} -> new/tracy-dynamic.tracy (0.6.3) {608221 KB}  90.42% size change
old/tracy-static.tracy (0.6.2) {2310589 KB} -> new/tracy-static.tracy (0.6.3) {2136791 KB}  92.48% size change
old/virtualfile_hc.tracy (0.6.2) {72169 KB} -> new/virtualfile_hc.tracy (0.6.3) {72142 KB}  99.96% size change
old/vk-mt.tracy (0.6.2) {10815 KB} -> new/vk-mt.tracy (0.6.3) {10714 KB}  99.07% size change
old/zfile_hc.tracy (0.6.2) {39065 KB} -> new/zfile_hc.tracy (0.6.3) {39063 KB}  100.00% size change
This commit is contained in:
Bartosz Taudul 2020-01-26 16:18:16 +01:00
parent f2a226407f
commit 3e45e4abd9
2 changed files with 18 additions and 12 deletions

View File

@ -940,19 +940,25 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
for( uint64_t i=0; i<sz; i++ )
{
auto td = m_slab.AllocInit<ThreadData>();
uint64_t tid, tsz;
f.Read3( tid, td->count, tsz );
uint64_t tid;
f.Read2( tid, td->count );
td->id = tid;
if( tsz != 0 )
int64_t refTime = 0;
if( fileVer < FileVersion( 0, 6, 3 ) )
{
if( fileVer < FileVersion( 0, 6, 3 ) )
uint64_t tsz;
f.Read( tsz );
if( tsz != 0 )
{
int64_t refTime = 0;
ReadTimelinePre063( f, td->timeline, tsz, refTime, childIdx, fileVer );
}
else
}
else
{
uint32_t tsz;
f.Read( tsz );
if( tsz != 0 )
{
int64_t refTime = 0;
ReadTimeline( f, td->timeline, tsz, refTime, childIdx );
}
}
@ -5003,7 +5009,7 @@ void Worker::ReconstructContextSwitchUsage()
void Worker::ReadTimeline( FileRead& f, ZoneEvent* zone, int64_t& refTime, int32_t& childIdx )
{
uint64_t sz;
uint32_t sz;
f.Read( sz );
if( sz == 0 )
{
@ -5124,7 +5130,7 @@ void Worker::CountZoneStatistics( ZoneEvent* zone )
}
#endif
void Worker::ReadTimeline( FileRead& f, Vector<short_ptr<ZoneEvent>>& _vec, uint64_t size, int64_t& refTime, int32_t& childIdx )
void Worker::ReadTimeline( FileRead& f, Vector<short_ptr<ZoneEvent>>& _vec, uint32_t size, int64_t& refTime, int32_t& childIdx )
{
assert( size != 0 );
auto& vec = *(Vector<ZoneEvent>*)( &_vec );
@ -5759,7 +5765,7 @@ void Worker::Write( FileWrite& f )
void Worker::WriteTimeline( FileWrite& f, const Vector<short_ptr<ZoneEvent>>& vec, int64_t& refTime )
{
uint64_t sz = vec.size();
uint32_t sz = uint32_t( vec.size() );
f.Write( &sz, sizeof( sz ) );
if( vec.is_magic() )
{
@ -5785,7 +5791,7 @@ void Worker::WriteTimelineImpl( FileWrite& f, const V& vec, int64_t& refTime )
f.Write( &v.extra, sizeof( v.extra ) );
if( v.Child() < 0 )
{
const uint64_t sz = 0;
const uint32_t sz = 0;
f.Write( &sz, sizeof( sz ) );
}
else

View File

@ -626,7 +626,7 @@ private:
tracy_force_inline ZoneExtra& GetZoneExtraMutable( const ZoneEvent& ev ) { return m_data.zoneExtra[ev.extra]; }
tracy_force_inline void AllocZoneExtra( ZoneEvent& ev );
void ReadTimeline( FileRead& f, Vector<short_ptr<ZoneEvent>>& vec, uint64_t size, int64_t& refTime, int32_t& childIdx );
void ReadTimeline( FileRead& f, Vector<short_ptr<ZoneEvent>>& vec, uint32_t size, int64_t& refTime, int32_t& childIdx );
void ReadTimelinePre063( FileRead& f, Vector<short_ptr<ZoneEvent>>& vec, uint64_t size, int64_t& refTime, int32_t& childIdx, int fileVer );
void ReadTimeline( FileRead& f, Vector<short_ptr<GpuEvent>>& vec, uint64_t size, int64_t& refTime, int64_t& refGpuTime, int32_t& childIdx );
void ReadTimelinePre0510( FileRead& f, Vector<short_ptr<GpuEvent>>& vec, uint64_t size, int64_t& refTime, int64_t& refGpuTime, int fileVer );