saul / demofile-net

Blazing fast cross-platform demo parser library for Counter-Strike 2, written in C#.
MIT License
76 stars 7 forks source link

Only read first entity snapshot from GOTV demos, fix position jittering #29

Closed saul closed 6 months ago

saul commented 6 months ago

Position jittering fixed by skipping over m_vecX/Y/Z that are entirely 0 bits (i.e. default(float)). Fixes #27

Improves GOTV parsing time by ~10%

Method Job Arguments Mean Error StdDev Ratio Gen0 Gen1 Gen2 Allocated Alloc Ratio
ParseDemo Job-IQMOBV /p:Baseline=true 1.513 s 0.0094 s 0.0079 s 1.00 104000.0000 19000.0000 9000.0000 703.21 MB 1.00
ParseDemo Job-TKWDSX Default 1.373 s 0.0216 s 0.0202 s 0.90 84000.0000 4000.0000 2000.0000 603.5 MB 0.86
github-actions[bot] commented 6 months ago

BenchmarkDotNet v0.13.9+228a464e8be6c580ad9408e98f18813f6407fb5a, Ubuntu 22.04.3 LTS (Jammy Jellyfish)
AMD EPYC 7763, 1 CPU, 4 logical and 2 physical cores
.NET SDK 8.0.100
  [Host]     : .NET 7.0.14 (7.0.1423.51910), X64 RyuJIT AVX2
  Job-WPEVXF : .NET 7.0.14 (7.0.1423.51910), X64 RyuJIT AVX2
  Job-VMPLNL : .NET 7.0.14 (7.0.1423.51910), X64 RyuJIT AVX2

InvocationCount=1  MaxIterationCount=16  UnrollFactor=1  
WarmupCount=1  
Method Job Arguments Mean Error StdDev Ratio Gen0 Gen1 Allocated Alloc Ratio
ParseDemo Job-WPEVXF /p:Baseline=true 2.655 s 0.0168 s 0.0157 s 1.00 7000.0000 1000.0000 681.38 MB 1.00
ParseDemo Job-VMPLNL Default 2.419 s 0.0063 s 0.0053 s 0.91 6000.0000 1000.0000 583.88 MB 0.86