Major protocol refactor: all byte[] payloads in SignalR hub/client interfaces, plumbing, and DTOs are now wrapped in SignalData, a disposable, ArrayPool-backed type with Span access. Introduces AyCodeBinaryHubProtocol (derived from AcBinaryHubProtocol) to rent pooled buffers for SignalData on receive. All message signatures, diagnostics, and serialization logic updated. Documentation and tests revised to reflect SignalData usage. Enables zero-copy, low-GC, high-performance binary messaging for large payloads. |
||
|---|---|---|
| .. | ||
| AyCode.Benchmark.csproj | ||
| JitDisassemblyBenchmark.cs | ||
| Program.cs | ||
| README.md | ||
| RefForeachBenchmark.cs | ||
| SerializationBenchmarks.cs | ||
| SignalRCommunicationBenchmarks.cs | ||
| SignalRRoundTripBenchmarks.cs | ||
| SourceGeneratorBenchmarks.cs | ||
| TaskHelperBenchmarks.cs | ||
| ValueTypePassingBenchmark.cs | ||
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,--jitasmmodes. Collects results toTest_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 vsinparameter for 16-byte types (Decimal, DateTimeOffset, Guid).
Dependencies
| Dependency | Purpose |
|---|---|
BenchmarkDotNet |
Benchmarking framework |
MessagePack |
Serialization comparison target |
MongoDB.Bson |
BSON comparison target |