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

Dictionary benchmarks #2904

Open
wants to merge 22 commits into
base: develop/main374
Choose a base branch
from
Open

Dictionary benchmarks #2904

wants to merge 22 commits into from

Conversation

mregen
Copy link
Contributor

@mregen mregen commented Dec 11, 2024

Proposed changes

Add more benchmarks for dictionaries.
Add benchmark.net test adapter.

Related Issues

  • Fixes #

Types of changes

What types of changes does your code introduce?
Put an x in the boxes that apply. You can also fill these out after creating the PR.

  • Bugfix (non-breaking change which fixes an issue)
  • Enhancement (non-breaking change which adds functionality)
  • Test enhancement (non-breaking change to increase test coverage)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected, requires version increase of Nuget packages)
  • Documentation Update (if none of the other choices apply)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING doc.
  • I have signed the CLA.
  • I ran tests locally with my changes, all passed.
  • I fixed all failing tests in the CI pipelines.
  • I fixed all introduced issues with CodeQL and LGTM.
  • I have added tests that prove my fix is effective or that my feature works and increased code coverage.
  • I have added necessary documentation (if appropriate).
  • Any dependent changes have been merged and published in downstream modules.

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ mregen
❌ dependabot[bot]
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link

codecov bot commented Dec 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 54.84%. Comparing base (f431d53) to head (5c7fcdf).
Report is 2 commits behind head on develop/main374.

Additional details and impacted files
@@                 Coverage Diff                 @@
##           develop/main374    #2904      +/-   ##
===================================================
+ Coverage            54.83%   54.84%   +0.01%     
===================================================
  Files                  349      349              
  Lines                66354    66355       +1     
  Branches             13619    13619              
===================================================
+ Hits                 36383    36394      +11     
+ Misses               25993    25979      -14     
- Partials              3978     3982       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mregen mregen marked this pull request as ready for review December 18, 2024 14:20
Copy link
Contributor

@romanett romanett left a comment

Choose a reason for hiding this comment

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

Two comments:

  • at least from server side common case is multiple threads accessing the same dictionary at the same time (currently mostly locked), this case is currently not really reflected in the benchmarks
  • Running Benchmarks with VSTest does not work for me:
========== Starting test discovery ==========
Failed to load benchmarks from assembly
System.IO.FileNotFoundException: Could not load file or assembly 'BenchmarkDotNet.TestAdapter, Version=0.13.12.0, Culture=neutral, PublicKeyToken=aa0ca2f9092cefc4' or one of its dependencies. The system cannot find the file specified.
File name: 'BenchmarkDotNet.TestAdapter, Version=0.13.12.0, Culture=neutral, PublicKeyToken=aa0ca2f9092cefc4'
   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Activator.CreateInstance(String assemblyString, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.AppDomain.CreateInstance(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.AppDomain.CreateInstanceAndUnwrap(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.AppDomain.CreateInstanceAndUnwrap(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at BenchmarkDotNet.TestAdapter.VsTestAdapter.CreateIsolatedType(Type type, String assemblyPath)
   at BenchmarkDotNet.TestAdapter.VsTestAdapter.GetVsTestCasesFromAssembly(String assemblyPath, IMessageLogger logger)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

An exception occurred while test discoverer 'VsTestAdapter' was loading tests. Exception: Could not load file or assembly 'BenchmarkDotNet.TestAdapter, Version=0.13.12.0, Culture=neutral, PublicKeyToken=aa0ca2f9092cefc4' or one of its dependencies. The system cannot find the file specified.
Failed to load benchmarks from assembly
System.IO.FileNotFoundException: Could not load file or assembly 'BenchmarkDotNet.TestAdapter, Version=0.13.12.0, Culture=neutral, PublicKeyToken=aa0ca2f9092cefc4' or one of its dependencies. The system cannot find the file specified.
File name: 'BenchmarkDotNet.TestAdapter, Version=0.13.12.0, Culture=neutral, PublicKeyToken=aa0ca2f9092cefc4'
   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Activator.CreateInstance(String assemblyString, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.AppDomain.CreateInstance(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.AppDomain.CreateInstanceAndUnwrap(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.AppDomain.CreateInstanceAndUnwrap(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at BenchmarkDotNet.TestAdapter.VsTestAdapter.CreateIsolatedType(Type type, String assemblyPath)
   at BenchmarkDotNet.TestAdapter.VsTestAdapter.GetVsTestCasesFromAssembly(String assemblyPath, IMessageLogger logger)

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.

3 participants