Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bench.ps1 and customize run and exporters #63

Merged
merged 2 commits into from
Jan 3, 2024

Conversation

nietras
Copy link
Contributor

@nietras nietras commented Jan 3, 2024

@joelverhagen a few proposed changes to benchmark running now that args are forwarded. I do not know if you prefer the old way if so I can change to whatever you prefer. This change means csv file output is more directly usable e.g. in Excel. As output is sorted and units only defined in column names.

Changed run parameters since Sep and others are quite fast now and below 200 ms for a run, this can be tweaked to whatever you like. Currently, show casing how one can filter and only run Sep methods by --filter *.Sep* allowing for incremental updates.

Method,Job,AnalyzeLaunchVariance,EvaluateOverhead,MaxAbsoluteError,MaxRelativeError,MinInvokeCount,MinIterationTime,OutlierMode,Affinity,EnvironmentVariables,Jit,LargeAddressAware,Platform,PowerPlanMode,Runtime,AllowVeryLargeObjects,Concurrent,CpuGroups,Force,HeapAffinitizeMask,HeapCount,NoAffinitize,RetainVm,Server,Arguments,BuildConfiguration,Clock,EngineFactory,NuGetReferences,Toolchain,IsMutator,InvocationCount,IterationCount,IterationTime,LaunchCount,MaxIterationCount,MaxWarmupIterationCount,MemoryRandomization,MinIterationCount,MinWarmupIterationCount,RunStrategy,UnrollFactor,WarmupCount,LineCount,Mean [ms],Error [ms],StdDev [ms],Gen0,Gen1,Gen2,Allocated [KB]
Sep_MT,Job-LGJPSJ,False,Default,Default,Default,Default,Default,Default,11111111111111111111111111111111,Empty,RyuJit,Default,X64,8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c,.NET 8.0,False,True,False,True,Default,Default,False,False,False,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,11,5,Default,5,3,Default,16,Default,1000000,309.0,35.37,25.58,16000.0000,15000.0000,1000.0000,268686.44
Sep,Job-LGJPSJ,False,Default,Default,Default,Default,Default,Default,11111111111111111111111111111111,Empty,RyuJit,Default,X64,8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c,.NET 8.0,False,True,False,True,Default,Default,False,False,False,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,11,5,Default,5,3,Default,16,Default,1000000,682.5,24.98,18.06,18000.0000,17000.0000,3000.0000,266674.98

Example console output
image

@nietras nietras mentioned this pull request Jan 3, 2024
@joelverhagen
Copy link
Owner

Wow, that's an amazing delta in mean between multi and single threaded! Nice work!

@@ -0,0 +1,3 @@
#!/usr/bin/env pwsh
# Add `--filter *.METHOD*` or similar to run subset of benchmarks
dotnet run -c Release --project NCsvPerf\NCsvPerf.csproj -- -m --minWarmupCount 3 --maxWarmupCount 5 --minIterationCount 5 --maxIterationCount 11
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will take a long time to run I think on my PC, but I guess that's fine. We'll see how it goes next time I update the blog. The original SimpleJob parameters were a nice balance between stability and fast runtime. I don't feel strongly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually just tweaked the params based on some more running. I underestimated how slow some of the entries are... I'll submit another PR 😅

@joelverhagen joelverhagen merged commit 78dc260 into joelverhagen:main Jan 3, 2024
2 checks passed
@nietras
Copy link
Contributor Author

nietras commented Jan 3, 2024

Wow, that's an amazing delta in mean between multi and single threaded! Nice work!

Thanks, it should be close to 2x but with server gc is even more. For the floats bench I have in Sep I am seeing up to 7x speedup for multi-threaded. The parallel implementation is extremely efficient. 🚀 Note that those specific numbers are on dotnet 8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants