Commit Graph

4 Commits

Author SHA1 Message Date
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 271f23d0f6 Enhance AcBinary: property filter, string interning, arrays
- Add property-level filtering via BinaryPropertyFilter delegate and context
- Improve string interning with new StringInternNew type code and promotion logic
- Optimize array and dictionary serialization for primitive types
- Expose strongly-typed property accessors for primitives and enums
- Add new benchmarks for serialization modes
- Refactor buffer pooling and cleanup code
- All new features are opt-in; maintains backward compatibility
2025-12-14 12:45:29 +01:00
Loretta 3b5a895fbc Add BSON to benchmarks; optimize AcBinary deserializer
- Add BSON (MongoDB.Bson) as a serialization format in benchmarks, enabling direct comparison with AcBinary, MessagePack, and JSON.
- Update all AcBinary benchmarks to use options without reference handling for fair comparison.
- Show BSON results and ratios in benchmark output and size comparisons.
- Refactor AcBinaryDeserializer to use a fixed-size array for type reader dispatch, improving lookup speed and reducing allocations.
- Add a concurrent cache for type conversion info to optimize enum and nullable conversions.
- Use a cached UTF8Encoding instance for string decoding.
- Use FrozenDictionary for property lookup in BinaryDeserializeTypeMetadata.
- Remove legacy WithRef code paths and clean up formatting and comments.
- Improve error handling and fallback logic for BSON serialization/deserialization.
2025-12-14 04:47:16 +01:00
Loretta 60238952d8 Rename BenchmarkSuite1 to AyCode.Benchmark project
Renamed the benchmark project from BenchmarkSuite1 to AyCode.Benchmark, updating the solution reference and moving all benchmark source files under the new project and namespace. No functional changes were made; this is a structural and naming reorganization for clarity and maintainability.
2025-12-13 10:11:39 +01:00