-
Notifications
You must be signed in to change notification settings - Fork 259
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 for ISet<T> (de)serialization and general framework fo… #540
Conversation
…r generic collections
|
||
namespace System.Text.Json.Serialization.Tests | ||
{ | ||
public class WriteGenericCollection |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File mismatch. ReadJson.X
has the test for Write and vice versa.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there another commit coming that resolves this @layomia ?
} | ||
|
||
[Benchmark] | ||
public ISet<string> DeserializeISet() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please share the perf results of any new tests added within the PR you add them in.
Nevermind, I see it in the PR: dotnet/corefx#38210
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the Error/Std Dev of some of the results shared, I recommend commenting out the RecommendedConfig before running the tests locally to improve accuracy.
For example, this is quite inaccurate:
DeserializeISet | 2 | 21,030.9 ns | 3,649.67 ns | 10,412.72 ns |
---|
.WithWarmupCount(1) // 1 warmup is enough for our purpose | |
.WithIterationTime(TimeInterval.FromMilliseconds(250)) // the default is 0.5s per iteration, which is slighlty too much for us | |
.WithMinIterationCount(15) | |
.WithMaxIterationCount(20) // we don't want to run more that 20 iterations |
src/benchmarks/micro/corefx/System.Text.Json/Serializer/ReadJson.GenericCollection.cs
Outdated
Show resolved
Hide resolved
@layomia similar to other stale PRs (#478, #530, #589) I have cloned your fork, updated the code and pushed some fixes. I need to make sure that we don't regress it for 3.0. PTAL at my changes dotnet run -c Release -f netcoreapp3.0 --filter *WriteJson<*Set*>* *ReadJson<*Set*>* --join BenchmarkDotNet=v0.11.3.1003-nightly, OS=Windows 10.0.18362
Intel Xeon CPU E5-1650 v4 3.60GHz, 1 CPU, 12 logical and 6 physical cores
.NET Core SDK=3.0.100-preview7-012697
[Host] : .NET Core 3.0.0-preview7-27826-20 (CoreCLR 4.700.19.32603, CoreFX 4.700.19.32613), 64bit RyuJIT
Job-KNHVRD : .NET Core 3.0.0-preview7-27826-20 (CoreCLR 4.700.19.32603, CoreFX 4.700.19.32613), 64bit RyuJIT
IterationTime=250.0000 ms MaxIterationCount=20 MinIterationCount=15
WarmupCount=1
|
@adamsitnik LGTM, thanks! |
…r generic collections
cc @ahsonkhan, @steveharter, @adamsitnik , @billwert