Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/redakker/codegeneratorbenchmark
https://github.com/redakker/codegeneratorbenchmark
Last synced: 26 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/redakker/codegeneratorbenchmark
- Owner: redakker
- Created: 2024-03-13T14:44:56.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-03-13T15:41:34.000Z (10 months ago)
- Last Synced: 2024-10-15T03:27:09.189Z (2 months ago)
- Language: C#
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This repo contains a proof of concept which has a benchmark for JSON serializer/deserializer.
It compares the running time of an object serialization which can be run in two ways.
- serialization/deserialization with a native JsonSerializable (Reflection)
- serialization/deserialization with code generatorThe relatively big Person (AI-generated) object in this example is initialized with different kinds of data.
Constants.cs contain how many people do you want to generate and (de)serialize.
This console app opens a CMD window which shows the benchmark results in the end of runtime.
Load it into Visual Studio and then start PersonSerializer in release mode.
You probably need to install the necessary Benchmark NuGet packages
˘˘˘
# Result of one measurement| Method | Mean | Error | StdDev | Median |
|------------------- |---------:|---------:|----------:|---------:|
| StartReflection | 48.51 ms | 4.317 ms | 12.729 ms | 48.95 ms |
| StartCodeGenerated | 32.35 ms | 2.452 ms | 7.231 ms | 28.43 ms |
˘˘˘