Skip to content

Conversation

@Sewer56
Copy link
Contributor

@Sewer56 Sewer56 commented Oct 3, 2022

  • This picks up from Optimize DateTime.Equals #59857 , adding the new equals implementation to the object.Equals() method, since previously the old implementation was still intact there.

Codegen Diff: https://www.diffchecker.com/O0mRKfb6 (-21 bytes)


Setup:

BenchmarkDotNet=v0.13.1.1847-nightly, OS=Windows 10 (10.0.19044.2075/21H2/November2021Update)
Intel Core i7-4790K CPU 4.00GHz (Haswell), 1 CPU, 8 logical and 4 physical cores
.NET SDK=7.0.100-rtm.22480.6
  [Host]     : .NET 7.0.0 (7.0.22.47809), X64 RyuJIT AVX2

Before:

py scripts\benchmarks_ci.py -f net7.0 --bdn-arguments="--artifacts "C:\results\latest_sdk"" --filter System.Tests.Perf_DateTime.Equals*

Job-NDINMX : .NET 7.0.0 (7.0.22.47809), X64 RyuJIT AVX2

PowerPlanMode=00000000-0000-0000-0000-000000000000  IterationTime=250.0000 ms  MaxIterationCount=20  
MinIterationCount=15  WarmupCount=1  

|       Method |     Mean |     Error |    StdDev |   Median |      Min |      Max | Code Size | Allocated |
|------------- |---------:|----------:|----------:|---------:|---------:|---------:|----------:|----------:|
| ObjectEquals | 1.392 ns | 0.0169 ns | 0.0150 ns | 1.389 ns | 1.365 ns | 1.420 ns |     210 B |         - |

After:

py scripts\benchmarks_ci.py -f net7.0 --bdn-arguments="--artifacts "C:\results\dev" -d" --filter System.Tests.Perf_DateTime.ObjectEquals* --corerun "C:\Users\sewer\Desktop\Projects\runtime\artifacts\bin\testhost\net7.0-windows-Release-x64\shared\Microsoft.NETCore.App\8.0.0\corerun.exe"

Job-YQMWEN : .NET 8.0.0 (42.42.42.42424), X64 RyuJIT AVX2

PowerPlanMode=00000000-0000-0000-0000-000000000000  Toolchain=CoreRun  IterationTime=250.0000 ms  
MaxIterationCount=20  MinIterationCount=15  WarmupCount=1  

|       Method |      Mean |     Error |    StdDev |    Median |       Min |       Max | Code Size | Allocated |
|------------- |----------:|----------:|----------:|----------:|----------:|----------:|----------:|----------:|
| ObjectEquals | 0.6923 ns | 0.0073 ns | 0.0061 ns | 0.6915 ns | 0.6826 ns | 0.7062 ns |     189 B |         - |

Benchmark: Sewer56/performance@2a762e3
dotnet/performance: dotnet/performance#2626

* This picks up from dotnet#59857 , adding the new equals implementation to the object.Equals() method.
@ghost
Copy link

ghost commented Oct 3, 2022

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Oct 3, 2022
@EgorBo EgorBo merged commit d520f57 into dotnet:main Oct 10, 2022
@EgorBo
Copy link
Member

EgorBo commented Oct 10, 2022

@Sewer56 thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Nov 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants