AyCode.Core/AyCode.Benchmark
Loretta 05808d0d13 SignalR: Add raw byte[] fast-path for DataSource GetAll
Implements a high-performance raw byte[] protocol path for SignalR DataSource GetAll/LoadDataSource, using a new IsRawBytesData flag in SignalParams. When enabled, the server pre-serializes response data and sends it as a byte array, which the protocol passes through without further (de)serialization. The client receives the raw bytes and deserializes as needed, avoiding double serialization/deserialization and improving performance for large payloads.

Adds SerializerType selection to DataSource, propagates SignalParams through hub and protocol layers, and updates client/server/test code to support the new path. Also includes diagnostics flags for binary serialization debugging and fixes for multi-segment buffer handling.
2026-04-07 00:20:52 +02:00
..
AyCode.Benchmark.csproj Update dependencies and expand README documentation 2026-03-20 16:42:51 +01:00
JitDisassemblyBenchmark.cs Optimize serializer with write plan for interning & refs 2026-02-15 17:28:06 +01:00
Program.cs Zero-copy SignalR: direct object response, no SignalData 2026-04-06 22:45:00 +02:00
README.md Document AcBinary wire format, sync docs, update conventions 2026-03-29 09:11:57 +02:00
RefForeachBenchmark.cs Refactor serialization infra, add perf benchmarks 2025-12-30 19:29:39 +01:00
SerializationBenchmarks.cs Zero-copy SignalR: direct object response, no SignalData 2026-04-06 22:45:00 +02:00
SignalRCommunicationBenchmarks.cs Refactor: Add high-perf JSON serializer & merge support 2025-12-14 19:34:49 +01:00
SignalRRoundTripBenchmarks.cs SignalR: Add raw byte[] fast-path for DataSource GetAll 2026-04-07 00:20:52 +02:00
SourceGeneratorBenchmarks.cs Refactor serializer options, string fast paths & analysis 2026-01-25 16:40:40 +01:00
TaskHelperBenchmarks.cs Rename BenchmarkSuite1 to AyCode.Benchmark project 2025-12-13 10:11:39 +01:00
ValueTypePassingBenchmark.cs Refactor serialization infra, add perf benchmarks 2025-12-30 19:29:39 +01:00

README.md

AyCode.Benchmark

BenchmarkDotNet-based performance benchmarking console app. Compares AcBinary serializer against MessagePack, BSON, and JSON across various scenarios.

Key Files

  • Program.cs — CLI entry point with --quick, --test, --minimal, --simple, --complex, --msgpack, --sizes, --jitasm modes. Collects results to Test_Benchmark_Results/ at solution root.
  • SerializationBenchmarks.cs — Primary suite: MinimalBenchmark, SimpleBinaryBenchmark, ComplexBinaryBenchmark, MessagePackComparisonBenchmark, AcBinaryVsMessagePackFullBenchmark, SizeComparisonBenchmark, LargeScaleBenchmark (~25K objects), AcJsonVsSystemTextJsonBenchmark.
  • SourceGeneratorBenchmarks.cs — Source-generated vs runtime reflection serializers. Includes PureContractlessBenchmark, SourceGeneratorVsRuntimeBenchmark, RepeatedStringBenchmark (string interning).
  • SignalRCommunicationBenchmarks.cs — Full-stack SignalR message performance: client creation → MessagePack serialization → server deserialization → response → round-trip.
  • SignalRRoundTripBenchmarks.cs — Real SignalR infrastructure benchmarks: primitives, complex objects, collections, mixed parameters.
  • JitDisassemblyBenchmark.cs — JIT analysis: generates .asm files to verify inlining decisions on serialize/deserialize hot paths.
  • TaskHelperBenchmarks.cs — Task/timing utilities: WaitToAsync, ThreadPool (custom vs Task.Run), timing methods (UtcNow.Ticks vs TickCount64).
  • RefForeachBenchmark.cs — Collection iteration patterns: array vs list, foreach vs index, ref readonly vs by-value for large structs.
  • ValueTypePassingBenchmark.cs — Copy-by-value vs in parameter for 16-byte types (Decimal, DateTimeOffset, Guid).

Dependencies

Dependency Purpose
BenchmarkDotNet Benchmarking framework
MessagePack Serialization comparison target
MongoDB.Bson BSON comparison target