-
Notifications
You must be signed in to change notification settings - Fork 45
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 framework #11
Conversation
I added benchmarks for pure classes as opposed to records (using the same sample data and the same number of items in the array): classes:
records:
The uptake is that on master right now, you take a ~60% hit by using records. |
I had to ZIP this SVG to attach it here. It shows a flamegraph of the results of stripping down the benchmark to just serializing a 1000-element array of that same record instance 1000 times. A large portion of the gap is from the reflection-based APIs forced on us by the |
Looks like we have our work cut out for us... For the PR itself, I think we should leave the Benchmark target out of the main FAKE pipeline and instead put a separate |
Fair enough :) I'll send those changes tomorrow! |
Ok, I pushed up that removal. I mostly included it by default because the outputs are written in github-markdown format, and so might be nice to include on a commit-by-commit basis. No worries though :) |
Minimal implementation of #7 that hooks up benchmarks into the build and provides a sample benchmark that compares serialization speed of an array of varying length containing multiple copies of a single test record instance.
The benchmark is done for Newtonsoft and System.Text.Json.
On my machine right now I get the following results: