Commit Graph

3 Commits

Author SHA1 Message Date
Loretta a832d8e86d Expand QuickBenchmark suite & add CLI scripts
Majorly enhanced QuickBenchmark.cs with new helper methods, standardized iteration count, and several comprehensive benchmarks comparing AcBinary (with/without reference handling) to MessagePack. Improved output formatting for clarity. Added RunQuickBenchmark.ps1 and .bat scripts for easy CLI execution and registered them as solution items. These changes make benchmarking more robust, readable, and user-friendly.
2025-12-15 12:00:03 +01:00
Loretta bc30a3aede Refactor: Add high-perf JSON serializer & merge support
- Introduced AcJsonSerializer/AcJsonDeserializer in AyCode.Core.Serializers.Jsons, optimized for IId<T> reference and circular reference handling.
- Added AcJsonSerializerOptions/AcSerializerOptions for configurable reference handling and max depth.
- Implemented fast-path streaming (Utf8JsonReader/Writer) with fallback to DOM for reference scenarios.
- Added type metadata/property accessor caching for performance.
- Provided robust object/collection population with merge semantics for IId<T> collections.
- Added AcJsonDeserializationException for detailed error reporting.
- Implemented UnifiedMergeContractResolver for Newtonsoft.Json, supporting JsonNoMergeCollectionAttribute to control merge behavior.
- Added IdAwareCollectionMergeConverter<TItem, TId> for merging IId<T> collections by ID.
- Included helpers for ID extraction and semantic ID generation.
- Added DeepPopulateWithMerge extension for deep merging.
- Optimized with frozen dictionaries, pre-encoded property names, and context pooling.
- Ensured compatibility with both System.Text.Json and Newtonsoft.Json.
2025-12-14 19:34:49 +01:00
Loretta b17c2df6c2 Add header-based string interning to AcBinarySerializer
- Support preloaded string intern table in binary header for efficient string interning and reduced output size.
- Add HeaderFlag_StringInternTable to BinaryTypeCode and update serializer/deserializer to handle intern tables.
- Simplify string interning logic: always intern eligible strings, remove candidate tracking.
- Refactor property name table and buffer management for clarity and efficiency.
- Remove obsolete interning/property name methods from serializer context.
- Add new output methods (ToArray, WriteTo, DetachResult) for buffer/result handling.
- Introduce QuickBenchmark.cs with benchmarks comparing AcBinarySerializer (with/without interning), JSON, and MessagePack, including repeated string scenarios.
2025-12-14 15:12:11 +01:00