saul / demofile-net

Blazing fast cross-platform demo parser library for Counter-Strike 2 and Valve's Deadlock, written in C#.
MIT License
111 stars 10 forks source link

Add ReadAllParallelAsync (multi-threaded parsing) #52

Closed saul closed 2 months ago

saul commented 8 months ago

Thanks @in0finite for the initial implementation. This is largely based off the ideas from #51

Closes #48 Closes #51

github-actions[bot] commented 2 months ago

BenchmarkDotNet v0.13.9+228a464e8be6c580ad9408e98f18813f6407fb5a, Ubuntu 22.04.4 LTS (Jammy Jellyfish)
AMD EPYC 7763, 1 CPU, 4 logical and 2 physical cores
.NET SDK 8.0.401
  [Host]     : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2
  Job-UFPXIW : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2
  Job-EDVGXU : .NET 8.0.8 (8.0.824.36612), X64 RyuJIT AVX2

InvocationCount=1  MaxIterationCount=16  UnrollFactor=1  
WarmupCount=1  
Method Job Arguments Mean Error StdDev Ratio RatioSD Gen0 Gen1 Allocated Alloc Ratio
ParseDemo Job-UFPXIW /p:Baseline=true NA NA NA ? ? NA NA NA ?
ParseDemo Job-EDVGXU Default 2.209 s 0.0179 s 0.0149 s ? ? 6000.0000 2000.0000 579.02 MB ?
ParseDemoParallel Job-UFPXIW /p:Baseline=true NA NA NA ? ? NA NA NA ?
ParseDemoParallel Job-EDVGXU Default 1.182 s 0.0228 s 0.0190 s ? ? 6000.0000 1000.0000 627.36 MB ?

Benchmarks with issues: DemoParserBenchmark.ParseDemo: Job-UFPXIW(Arguments=/p:Baseline=true, InvocationCount=1, MaxIterationCount=16, UnrollFactor=1, WarmupCount=1) DemoParserBenchmark.ParseDemoParallel: Job-UFPXIW(Arguments=/p:Baseline=true, InvocationCount=1, MaxIterationCount=16, UnrollFactor=1, WarmupCount=1)