Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Add Microsoft.Experimental.Collections package and move MultivalueDictionary to it #2439

Merged
merged 11 commits into from
Aug 25, 2018

Conversation

safern
Copy link
Member

@safern safern commented Aug 21, 2018

This is the beginning of a new package to experiment new collections before adding them to .NET Core.

Related to: #2406

I tried to split it per commit to make it easier to review since I did code cleanup and some modifications for the source to be able to build.

cc: @ahsonkhan @danmosemsft @joshfree @terrajobst

Netcoreapp2.1

BenchmarkDotNet=v0.10.14.683-nightly, OS=Windows 10.0.17134.228 (1803/April2018Update/Redstone4)
Intel Core i7-6700 CPU 3.40GHz (Skylake), 1 CPU, 8 logical and 4 physical cores
.NET Core SDK=2.1.400
  [Host]     : .NET Core 2.1.2 (CoreCLR 4.6.26628.05, CoreFX 4.6.26629.01), 64bit RyuJIT
  DefaultJob : .NET Core 2.1.2 (CoreCLR 4.6.26628.05, CoreFX 4.6.26629.01), 64bit RyuJIT
  Job-NHNLWK : .NET Core 2.1.2 (CoreCLR 4.6.26628.05, CoreFX 4.6.26629.01), 64bit RyuJIT

InvocationCount=1  
Method UnrollFactor Size Mean Error StdDev Median Gen 0 Gen 1 Gen 2 Allocated
Remove 16 1000 8.1041 ns 0.2047 ns 0.4577 ns 7.9432 ns - - - 0 B
Clear 16 1000 3.0424 ns 0.0536 ns 0.0475 ns 3.0369 ns - - - 0 B
Ctor 16 1000 29.8753 ns 0.8742 ns 2.5363 ns 29.3861 ns 0.0286 - - 120 B
Ctor_Size 16 1000 1,242.4293 ns 23.1684 ns 20.5382 ns 1,238.6374 ns 7.4062 - - 31056 B
GetItem 16 1000 9.4785 ns 0.2730 ns 0.3827 ns 9.3378 ns - - - 0 B
GetKeys 16 1000 0.2470 ns 0.0814 ns 0.0761 ns 0.2321 ns - - - 0 B
TryGetValue 16 1000 13.1827 ns 0.1875 ns 0.1566 ns 13.2032 ns - - - 0 B
ContainsKey 16 1000 7.3598 ns 0.2046 ns 0.2356 ns 7.2929 ns - - - 0 B
Add 1 1000 2,021.2921 ns 369.8309 ns 1,024.7997 ns 1,655.0000 ns - - - 112 B
AddRange 1 1000 21,370.3191 ns 1,851.3878 ns 5,282.1136 ns 20,415.0000 ns - - - 8640 B
ContainsValue 1 1000 23,338.4211 ns 2,529.2090 ns 7,256.7747 ns 21,610.0000 ns - - - 24 B
Remove 16 10000 8.8951 ns 0.1356 ns 0.1268 ns 8.8496 ns - - - 0 B
Clear 16 10000 2.3970 ns 0.0266 ns 0.0249 ns 2.3974 ns - - - 0 B
Ctor 16 10000 28.1711 ns 0.2680 ns 0.2376 ns 28.1338 ns 0.0286 - - 120 B
Ctor_Size 16 10000 24,238.1572 ns 483.0693 ns 723.0354 ns 24,036.7049 ns 76.9043 76.9043 76.9043 283056 B
GetItem 16 10000 8.7379 ns 0.0643 ns 0.0502 ns 8.7431 ns - - - 0 B
GetKeys 16 10000 0.1892 ns 0.0887 ns 0.0830 ns 0.1553 ns - - - 0 B
TryGetValue 16 10000 13.3620 ns 0.1697 ns 0.1504 ns 13.3821 ns - - - 0 B
ContainsKey 16 10000 7.1878 ns 0.1160 ns 0.1029 ns 7.1808 ns - - - 0 B
Add 1 10000 8,293.6842 ns 1,666.9007 ns 4,782.6506 ns 6,860.0000 ns - - - 112 B
AddRange 1 10000 118,454.7959 ns 7,175.4051 ns 20,930.9936 ns 110,165.0000 ns - - - 131616 B
ContainsValue 1 10000 358,143.0000 ns 63,401.7303 ns 186,941.4324 ns 291,205.0000 ns - - - 24 B
Remove 16 100000 8.2764 ns 0.1140 ns 0.1067 ns 8.2485 ns - - - 0 B
Clear 16 100000 2.1360 ns 0.0443 ns 0.0414 ns 2.1468 ns - - - 0 B
Ctor 16 100000 28.0887 ns 0.4390 ns 0.3892 ns 28.0935 ns 0.0286 - - 120 B
Ctor_Size 16 100000 204,249.1040 ns 4,025.7578 ns 8,751.6662 ns 203,609.7721 ns 120.1172 119.8730 119.8730 3042387 B
GetItem 16 100000 8.8474 ns 0.0775 ns 0.0725 ns 8.8379 ns - - - 0 B
GetKeys 16 100000 0.1426 ns 0.0303 ns 0.0283 ns 0.1454 ns - - - 0 B
TryGetValue 16 100000 13.0828 ns 0.1116 ns 0.1044 ns 13.0361 ns - - - 0 B
ContainsKey 16 100000 7.6709 ns 0.0665 ns 0.0622 ns 7.6756 ns - - - 0 B
Add 1 100000 5,191.6667 ns 425.3363 ns 1,142.6384 ns 4,925.0000 ns - - - 112 B
AddRange 1 100000 1,123,335.2198 ns 33,810.8797 ns 94,809.3317 ns 1,104,355.0000 ns - - - 1049192 B
ContainsValue 1 100000 1,849,647.1264 ns 39,056.3272 ns 106,916.0656 ns 1,826,400.0000 ns - - - 24 B

.NET Framework 4.7.2

BenchmarkDotNet=v0.10.14.683-nightly, OS=Windows 10.0.17134.228 (1803/April2018Update/Redstone4)
Intel Core i7-6700 CPU 3.40GHz (Skylake), 1 CPU, 8 logical and 4 physical cores
  [Host]     : .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3132.0
  Job-HYXTWV : .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3132.0
  Job-YUBWZE : .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3132.0

Runtime=Clr  InvocationCount=1  
Method UnrollFactor Size Mean Error StdDev Median Gen 0 Gen 1 Gen 2 Allocated
Remove 16 1000 8.2892 ns 0.2010 ns 0.2393 ns 8.2756 ns - - - 0 B
Clear 16 1000 1.5074 ns 0.0164 ns 0.0145 ns 1.5097 ns - - - 0 B
Ctor 16 1000 30.4139 ns 0.4319 ns 0.4040 ns 30.2620 ns 0.0286 - - 120 B
Ctor_Size 16 1000 1,868.9655 ns 37.2866 ns 92.8567 ns 1,830.3931 ns 7.4062 - - 31071 B
GetItem 16 1000 12.2440 ns 0.1013 ns 0.0846 ns 12.2189 ns - - - 0 B
GetKeys 16 1000 0.5689 ns 0.0301 ns 0.0267 ns 0.5682 ns - - - 0 B
TryGetValue 16 1000 16.0656 ns 0.1361 ns 0.1273 ns 16.1036 ns - - - 0 B
ContainsKey 16 1000 9.0728 ns 0.1337 ns 0.1185 ns 9.0472 ns - - - 0 B
Add 1 1000 1,431.8750 ns 41.5313 ns 119.8272 ns 1,410.0000 ns - - - 0 B
AddRange 1 1000 13,578.3333 ns 656.2274 ns 1,829.2996 ns 14,225.0000 ns - - - 16384 B
ContainsValue 1 1000 14,425.7692 ns 273.8879 ns 228.7087 ns 14,395.0000 ns - - - 0 B
Remove 16 10000 8.1024 ns 0.0953 ns 0.0845 ns 8.0747 ns - - - 0 B
Clear 16 10000 2.2857 ns 0.0414 ns 0.0387 ns 2.2817 ns - - - 0 B
Ctor 16 10000 29.7757 ns 0.6177 ns 0.5158 ns 29.4788 ns 0.0286 - - 120 B
Ctor_Size 16 10000 31,540.4917 ns 478.4834 ns 424.1630 ns 31,319.5907 ns 76.9043 76.9043 76.9043 283590 B
GetItem 16 10000 12.7313 ns 0.3302 ns 0.4407 ns 12.6218 ns - - - 0 B
GetKeys 16 10000 0.6943 ns 0.0910 ns 0.0806 ns 0.6829 ns - - - 0 B
TryGetValue 16 10000 17.2545 ns 0.3838 ns 0.3770 ns 17.1683 ns - - - 0 B
ContainsKey 16 10000 9.2249 ns 0.1221 ns 0.1020 ns 9.2248 ns - - - 0 B
Add 1 10000 10,617.6316 ns 2,114.0197 ns 6,065.5189 ns 8,145.0000 ns - - - 0 B
AddRange 1 10000 118,771.0000 ns 8,281.5717 ns 24,418.4010 ns 111,845.0000 ns - - - 139456 B
ContainsValue 1 10000 440,755.0000 ns 69,062.3520 ns 203,631.9032 ns 415,780.0000 ns - - - 0 B
Remove 16 100000 8.3874 ns 0.2194 ns 0.3726 ns 8.2348 ns - - - 0 B
Clear 16 100000 1.4453 ns 0.0547 ns 0.0457 ns 1.4339 ns - - - 0 B
Ctor 16 100000 31.7338 ns 0.7104 ns 1.5594 ns 31.3275 ns 0.0286 - - 120 B
Ctor_Size 16 100000 416,938.1498 ns 8,690.4744 ns 18,707.1630 ns 412,478.5612 ns 209.9609 209.4727 209.4727 3044186 B
GetItem 16 100000 12.5235 ns 0.3088 ns 0.3033 ns 12.4278 ns - - - 0 B
GetKeys 16 100000 0.5701 ns 0.0706 ns 0.0626 ns 0.5659 ns - - - 0 B
TryGetValue 16 100000 16.5617 ns 0.2622 ns 0.2324 ns 16.5626 ns - - - 0 B
ContainsKey 16 100000 9.6370 ns 0.2285 ns 0.3349 ns 9.5697 ns - - - 0 B
Add 1 100000 7,677.9381 ns 1,133.1398 ns 3,287.4439 ns 6,180.0000 ns - - - 0 B
AddRange 1 100000 1,088,360.1020 ns 33,018.9253 ns 96,317.7550 ns 1,080,155.0000 ns - - - 1057032 B
ContainsValue 1 100000 1,900,663.0435 ns 52,525.1459 ns 148,148.1058 ns 1,844,400.0000 ns - - - 0 B

<PropertyGroup>
<Description>This package provides collections that are being considered for future versions of .NET Core.</Description>
<TargetFramework>netstandard2.0</TargetFramework>
<PackageTags>collections, system, microsoft, fastdictionary, multivaluedictionary</PackageTags>
Copy link
Member

Choose a reason for hiding this comment

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

As I discovered recently, nuget splits tags on spaces. You should have no commas

Copy link
Member

Choose a reason for hiding this comment

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

I don't think anyone will search for "fastdictionary"

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, will change to spaces.

<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\tools\common.props" />
<PropertyGroup>
<Description>This package provides collections that are being considered for future versions of .NET Core.</Description>
Copy link
Member

Choose a reason for hiding this comment

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

What about something like This package contains some useful collections that are not currently included in .NET Core itself.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, I see you are using the existing description. It's fine let's stick with that.

Copy link
Member Author

Choose a reason for hiding this comment

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

I did change the description, the base is the same, just changed .NET Framework -> .NET Core.

[Benchmark]
public void ContainsValue()
{
for (int i = 0; i <= 20000; i++)
Copy link
Member

Choose a reason for hiding this comment

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

Is it necessary to have such a for loop (along with loop unrolling)? Also, with different iteration counts, how do we reason about/compare the perf results?

cc @adamsitnik

Copy link
Member Author

Choose a reason for hiding this comment

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

This is how the old perf tests where, creating a for loop for every iteration, that is why I left it. I don't know if it makes sense to just do it once instead of within a loop, I wonder if getting rid of this loops will give us a more realistic result.

Copy link
Member

@ahsonkhan ahsonkhan Aug 21, 2018

Choose a reason for hiding this comment

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

The previous tests used xunit.performance which didn't have some of the capabilities that BDN has. One of the capabilities is to detect the iteration count automatically. It also attempts to be accurate for nano-benchmarks by measuring/eliminating the idle time costs. Since this is a port to BDN, we can take advantage of these to simplify the tests.

I wonder if getting rid of this loops will give us a more realistic result.

If it doesn't work well in these scenarios, it would be good feedback for @adamsitnik

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, then I will get rid of the loops and let BDN handle the iterations.

[Benchmark]
public void Ctor()
{
for (int i = 0; i <= 20000; i++)
Copy link
Member

@ahsonkhan ahsonkhan Aug 21, 2018

Choose a reason for hiding this comment

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

Couldn't some of these tests simply be the Ctor call with nothing else (let BDN take care of iterations/etc.)?

[Benchmark]
public void Ctor()
{
    var dict = new MultiValueDictionary<int, string>();
}

Copy link
Member Author

Choose a reason for hiding this comment

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

I guess yes, we could just let BDN take care of the iterations and just call the ctor once.

}
}

public List<int> values;
Copy link
Member

Choose a reason for hiding this comment

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

nit: Should this be a private field? If not, use PascalCasing.

Copy link
Member Author

Choose a reason for hiding this comment

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

Will change to be private.


public MultiValueDictionary<int, int> dict;

[GlobalSetup(Targets = new[] { nameof(Add), nameof(Clear), nameof(GetItem), nameof(GetKeys), nameof(ContainsValue) })]
Copy link
Member

Choose a reason for hiding this comment

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

Interesting use of GlobalSetup. I didn't know you could specify benchmark specific setups like this. Good to know :)

[Params(1000, 10000, 10000)]
public int Size { get; set; }

public int RandomKey { get; set; }
Copy link
Member

Choose a reason for hiding this comment

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

In other benchmarks, we tend to use private fields rather than public properties. Any specific reason why you opted for properties instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

I was going to use [Params] in this property and that is why I used public. I didn't know if when using [Params] it can be public, don't know how benchmark initializes the property with the specified parameters in the attribute.

However, I will update to make the dictionary, list and randomkey private 😄

Copy link
Member

Choose a reason for hiding this comment

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

[Params] requires it to be either a public property with public setter or public non-readonly field

<Description>This package provides collections that are being considered for future versions of .NET Core.</Description>
<TargetFramework>netstandard2.0</TargetFramework>
<PackageTags>collections, system, microsoft, fastdictionary, multivaluedictionary</PackageTags>
<VersionPrefix>1.0.4</VersionPrefix>
Copy link
Member

Choose a reason for hiding this comment

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

Why are we adding a custom version prefix?

We have one coming from common.props:

<VersionPrefix>0.1.0</VersionPrefix>

Copy link
Member Author

Choose a reason for hiding this comment

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

This package already exists in NuGet

https://www.nuget.org/packages/Microsoft.Experimental.Collections/1.0.3-alpha

So, unfortunately we need to have a custom version for this package unaligned for the other packages in this repo.

Copy link
Member

@ahsonkhan ahsonkhan Aug 21, 2018

Choose a reason for hiding this comment

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

I see. We don't publish to NuGet though, but to a custom MyGet feed, so there shouldn't be any conflicts.
https://dotnet.myget.org/gallery/dotnet-corefxlab

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, but we're planning to publish this package to NuGet, because we want to start using this collections for some public benchmarks out there and for that we should put it into NuGet.

Copy link
Member

Choose a reason for hiding this comment

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

Sounds good. Thanks for the clarification.

Copy link
Member

@ahsonkhan ahsonkhan left a comment

Choose a reason for hiding this comment

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

Otherwise, LGTM. Can you please share the benchmark results (as a current snapshot). I am curious to see them.

@ahsonkhan ahsonkhan requested a review from adamsitnik August 21, 2018 23:10

namespace Microsoft.Collections.Extensions.Tests
{
public class MultiValueDictionaryPerformanceTests
Copy link
Member

@ahsonkhan ahsonkhan Aug 21, 2018

Choose a reason for hiding this comment

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

Do we care about memory allocations for this type/benchmarks? If so, it might be useful to add a [MemoryDiagnoser] attribute on the class.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it would be good to have those numbers to have a reference of improvements if we invest on that later on. I will add it.

@safern safern force-pushed the AddCollectionsPackage branch from abdb0c7 to f9c51e5 Compare August 22, 2018 17:40
@safern
Copy link
Member Author

safern commented Aug 22, 2018

I updated the perf tests and the description to contain the results.

@adamsitnik I'm getting this warnings:

// * Warnings *
MinIterationTime
  MultiValueDictionaryPerformanceTests.Add: InvocationCount=1, UnrollFactor=1           -> MinIterationTime = 1.2000 us which is very small. It's recommended to increase it.
  MultiValueDictionaryPerformanceTests.AddRange: InvocationCount=1, UnrollFactor=1      -> MinIterationTime = 12.5000 us which is very small. It's recommended to increase it.
  MultiValueDictionaryPerformanceTests.ContainsValue: InvocationCount=1, UnrollFactor=1 -> MinIterationTime = 13.9000 us which is very small. It's recommended to increase it.
  MultiValueDictionaryPerformanceTests.Add: InvocationCount=1, UnrollFactor=1           -> MinIterationTime = 1.8000 us which is very small. It's recommended to increase it.
  MultiValueDictionaryPerformanceTests.AddRange: InvocationCount=1, UnrollFactor=1      -> MinIterationTime = 97.3000 us which is very small. It's recommended to increase it.
  MultiValueDictionaryPerformanceTests.ContainsValue: InvocationCount=1, UnrollFactor=1 -> MinIterationTime = 129.8000 us which is very small. It's recommended to increase it.
  MultiValueDictionaryPerformanceTests.Add: InvocationCount=1, UnrollFactor=1           -> MinIterationTime = 3.9000 us which is very small. It's recommended to increase it.
  MultiValueDictionaryPerformanceTests.AddRange: InvocationCount=1, UnrollFactor=1      -> MinIterationTime = 958.6000 us which is very small. It's recommended to increase it.
  MultiValueDictionaryPerformanceTests.ContainsValue: InvocationCount=1, UnrollFactor=1 -> MinIterationTime = 1.6391 ms which is very small. It's recommended to increase it.
MultimodalDistribution
  MultiValueDictionaryPerformanceTests.Ctor: Default                                    -> It seems that the distribution is bimodal (mValue = 3.36)
  MultiValueDictionaryPerformanceTests.Ctor_Size: Default                               -> It seems that the distribution can have several modes (mValue = 2.87)
  MultiValueDictionaryPerformanceTests.GetItem: Default                                 -> It seems that the distribution is bimodal (mValue = 3.79)
  MultiValueDictionaryPerformanceTests.GetKeys: Default                                 -> It seems that the distribution is bimodal (mValue = 3.84)
  MultiValueDictionaryPerformanceTests.AddRange: InvocationCount=1, UnrollFactor=1      -> It seems that the distribution is bimodal (mValue = 3.9)
  MultiValueDictionaryPerformanceTests.ContainsValue: InvocationCount=1, UnrollFactor=1 -> It seems that the distribution is multimodal (mValue = 4.63)
  MultiValueDictionaryPerformanceTests.Add: InvocationCount=1, UnrollFactor=1           -> It seems that the distribution is bimodal (mValue = 3.48)
  MultiValueDictionaryPerformanceTests.ContainsValue: InvocationCount=1, UnrollFactor=1 -> It seems that the distribution can have several modes (mValue = 2.95)
  MultiValueDictionaryPerformanceTests.Clear: Default                                   -> It seems that the distribution is bimodal (mValue = 3.43)
  MultiValueDictionaryPerformanceTests.Ctor: Default                                    -> It seems that the distribution can have several modes (mValue = 3.14)
  MultiValueDictionaryPerformanceTests.GetKeys: Default                                 -> It seems that the distribution is bimodal (mValue = 4)

Could you please help me on how to solve them?


private void SetValue()
{
if (Size > 104)
Copy link
Member

Choose a reason for hiding this comment

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

Was this supposed to be 1024?

And should these be >=?

Copy link
Member

@adamsitnik adamsitnik left a comment

Choose a reason for hiding this comment

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

@safern recently I was porting all the CoreFX dictionary benchmarks to BDN and rewrote all of them. You can find them in the performance repo https://github.com/dotnet/performance/search?q=Dictionary&unscoped_q=Dictionary

The benchmarks you have written are OK, you might take a look at what I wrote and copy the ideas if you want to.

Please remember to return the result from benchmark method to avoid dead code elimination.

Random rand = new Random(11231992);

while (_dict.Count < Size)
_dict.Add(rand.Next(), rand.Next());
Copy link
Member

Choose a reason for hiding this comment

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

what if the dictionary contains given key? will Add throw an exception?

Copy link
Member Author

@safern safern Aug 24, 2018

Choose a reason for hiding this comment

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

No, since this is a multivalue dictionary it allows to have multiple values for the same key, so if the key already exists it just adds the value to the key's collection of values.

public void Add(TKey key, TValue value)
{
if (key == null)
throw new ArgumentNullException(nameof(key));
if (!_dictionary.TryGetValue(key, out InnerCollectionView collection))
{
collection = new InnerCollectionView(key, NewCollectionFactory());
_dictionary.Add(key, collection);
}
collection.AddValue(value);
_version++;
}

[Benchmark]
public void Ctor()
{
var _ = new MultiValueDictionary<int, string>();
Copy link
Member

Choose a reason for hiding this comment

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

to prevent from dead code elimination by JIT you need to return the result from a method. This applies to this and all other benchmarks

@safern
Copy link
Member Author

safern commented Aug 23, 2018

The benchmarks you have written are OK, you might take a look at what I wrote and copy the ideas if you want to.

Please remember to return the result from benchmark method to avoid dead code elimination.

Thanks for the pointer. I will take a look and update accordingly.

@safern
Copy link
Member Author

safern commented Aug 24, 2018

I updated the perf tests to actually return a value and also updated the PR description to include perf results for netcoreapp2.1 and net472.

@danmoseley
Copy link
Member

@adamsitnik isn't there a way to get BDN to show both A and B results in the same table, ie. showing the ratio, so I don't have to scroll back and forth? Perhaps that's not possible here as it's different frameworks.

@safern
Copy link
Member Author

safern commented Aug 24, 2018

@adamsitnik isn't there a way to get BDN to show both A and B results in the same table, ie. showing the ratio, so I don't have to scroll back and forth? Perhaps that's not possible here as it's different frameworks.

That would be handy.

@danmoseley
Copy link
Member

Interesting that .NET Core is not faster/equal in every case. Eg., TryGetValue | 16 | 1000. Significant slower.

@safern
Copy link
Member Author

safern commented Aug 25, 2018

Interesting that .NET Core is not faster/equal in every case. Eg., TryGetValue | 16 | 1000. Significant slower.

I saw the same thing. Maybe the way I hooked up the tests? Basically I just changed targetframework to net472.

@safern safern merged commit c154265 into dotnet:master Aug 25, 2018
@safern safern deleted the AddCollectionsPackage branch August 25, 2018 00:23
@adamsitnik
Copy link
Member

isn't there a way to get BDN to show both A and B results in the same table, ie. showing the ratio, so I don't have to scroll back and forth? Perhaps that's not possible here as it's different frameworks.

@danmosemsft sure!

First of all we need to add .NET 4.7.2 to Benchmarks.csproj

<TargetFrameworks>netcoreapp2.1;net472</TargetFrameworks>

Then from console line arguments:

--runtimes clr core

an example: dotnet run -c Release -f netcoreapp2.1 -- -f *Corefx* --runtimes clr core

More info in the docs

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

Successfully merging this pull request may close these issues.

4 participants