-
-
Notifications
You must be signed in to change notification settings - Fork 84
Add basic serialize/deserialize benchmarks #107
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
Conversation
using BenchmarkDotNet.Jobs; | ||
using Newtonsoft.Json; | ||
|
||
[SimpleJob(RuntimeMoniker.NetCoreApp30)] |
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.
There are a few more useful atrributes that could be added here to generate some graphs and more stats. See https://github.com/Dotnet-Boxed/Framework/blob/master/Benchmarks/Boxed.Mapping.Benchmark/MapListBenchmark.cs
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.
Yep, happy to add those. Do you think it is worth benchmarking multiple versions of .NET like your linked example or just leave it still as .NET Core 3?
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.
.NET Framework is still used a fair bit, so I added it. The results can be very different.
Only one comment. Looks good apart from that. |
6c40de8
to
48991b8
Compare
I've added the additional benchmark settings that you've linked to. Yeah, there is a bit of a difference between .NET 4.7.2 and .NET Core 3:
|
Thanks! |
As I mentioned in #100 , it would be a good idea to add some benchmarks to Schema.NET, specifically around the serialization/deserialization process.
While the core serialization processing might be in a third-party library (either
Newtonsoft.Json
or eventuallySystem.Text.Json
), there are multiple custom converters used in the library which may have their own performance bottlenecks.The benchmarks, however, are also useful for gauging the performance improvement when going to
System.Text.Json
too.I've specifically included 2 benchmarks, one testing
WebSite
with a fairly basic model (taken from theWebSiteTest
) and one forBook
(taken fromBookTest
). While there isn't anything to really base these numbers on at the moment, it can help for relative improvements.I may add more specialised benchmarks, specifically targeting the
ValuesJsonConverter
in the future as that is where I believe the biggest gains are in the library.Book Benchmark
WebSite Benchmark