AyCode.Core/AyCode.Core.Serializers.Con...
Loretta 26c8cd85ce Refactor BenchmarkTestDataProvider for flexibility & clarity
Moved BenchmarkTestDataProvider and TestDataSet to AyCode.Core.Tests.TestModels with public accessibility. Refactored dataset creation methods to accept a resetId parameter, allowing control over TestDataFactory ID resets. Improved code structure, formatting, and documentation for maintainability. The provider is now more flexible and easier to use in tests.
2026-04-07 14:27:12 +02:00
..
AyCode.Core.Serializers.Console.csproj Add MemoryPack benchmarks and model support 2026-02-16 07:59:24 +01:00
Program.cs Improve benchmark reporting and add LLM-friendly results 2026-04-04 11:02:08 +02:00
README.md Document AcBinary wire format, sync docs, update conventions 2026-03-29 09:11:57 +02:00

README.md

AyCode.Core.Serializers.Console

Standalone benchmark console application for comparing serializer performance. Targets .NET 9. Measures serialize/deserialize speed, output size, and compression across multiple serializers and data shapes.

Compared Serializers

  • AcBinary — Multiple configurations: Default, NoRef, FastMode, NoIntern, with/without source generation
  • MessagePack
  • MemoryPack

(System.Text.Json and Newtonsoft.Json comparisons exist but are currently commented out.)

Key Files

  • Program.cs — Benchmark runner. Modes: all (default), quick (fewer iterations), serialize, deserialize, profiler (memory profiler warmup). Outputs results to Test_Benchmark_Results/Benchmark/. Iterations: 5000 warmup + 1000 test (Release), 0+1 (Debug).
  • BenchmarkTestDataProvider.cs — Test data factory producing 5 data shapes:
    • Small (2x2x2x2), Medium (3x3x3x4), Large (5x5x5x10)
    • Repeated Strings (10 items, string deduplication testing)
    • Deep Nested (2x4x4x8, depth stress test)
    • Uses TestOrder model from AyCode.Core.Tests with configurable IId reference percentages.

Dependencies

Dependency Purpose
AyCode.Core Core library with AcBinary serializer
AyCode.Core.Tests Test models (TestOrder, TestDataFactory, etc.)
MemoryPack Competitor benchmark
MessagePack Competitor benchmark
Newtonsoft.Json Competitor benchmark