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 benchmarks project #1091

Merged
merged 1 commit into from
Jun 8, 2023
Merged

Add benchmarks project #1091

merged 1 commit into from
Jun 8, 2023

Conversation

lahma
Copy link
Collaborator

@lahma lahma commented Jun 3, 2023

This PR adds a new benchmark project which utilizes BenchmarkDotNet for precise and repeatable results. I adjusted test cases from this blog post to create presentation of areas.

I have diff tools that I can use to show performance changes between master and proposed optimization.

You can run the benchmarks by simply running the benchmarks project using Release configuration. It will as what benchmark(s) to run.

My first PR will tackle the LargeExcelFileBenchmark.Evaluate which is obviously the worst case at the moment as it takes over a minute to complete on my desktop.

Current results

BenchmarkDotNet=v0.13.5, OS=Windows 11 (10.0.23466.1001)
AMD Ryzen 9 5950X, 1 CPU, 32 logical and 16 physical cores
.NET SDK=7.0.302
  [Host]   : .NET 6.0.16 (6.0.1623.17311), X64 RyuJIT AVX2
  ShortRun : .NET 6.0.16 (6.0.1623.17311), X64 RyuJIT AVX2

Job=ShortRun  IterationCount=3  LaunchCount=1  
WarmupCount=3  

NPOI.Benchmarks.LargeExcelFileBenchmark

Method Mean Error StdDev Gen0 Gen1 Gen2 Allocated
Load 11.741 s 1.1257 s 0.0617 s 232000.0000 109000.0000 3000.0000 3.65 GB
Write 3.483 s 0.1738 s 0.0095 s 44000.0000 - - 1.19 GB
Evaluate 62.677 s 4.1891 s 0.2296 s 4810000.0000 1353000.0000 - 75.32 GB

NPOI.Benchmarks.RangeValuesBenchmark

Method RowCount ColumnCount Mean Error StdDev Gen0 Gen1 Gen2 Allocated
Double 1000 30 85.46 ms 0.367 ms 0.343 ms 2000.0000 1000.0000 500.0000 31.45 MB
String 1000 30 99.93 ms 0.449 ms 0.420 ms 4400.0000 2000.0000 1000.0000 59.32 MB
Date 1000 30 114.71 ms 1.603 ms 1.499 ms 3000.0000 2000.0000 1200.0000 35.73 MB
Formulas 1000 30 1,064.12 ms 10.889 ms 9.653 ms 94000.0000 27000.0000 4000.0000 1480.15 MB

@tonyqus
Copy link
Member

tonyqus commented Jun 8, 2023

LGTM

@tonyqus tonyqus merged commit 5996a73 into nissl-lab:master Jun 8, 2023
3 checks passed
@lahma lahma deleted the add-benchmarks branch June 8, 2023 19:23
@tonyqus tonyqus added this to the NPOI 2.6.1 milestone Aug 31, 2023
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.

None yet

2 participants