Releases: cocoar-dev/Cocoar.Json.Mutable
Releases · cocoar-dev/Cocoar.Json.Mutable
Release list
v1.2.0
v1.1.0
v1.0.1
What's Changed
Performance Fixes
Eliminated unnecessary double allocations in three hot paths:
- Number parsing:
MutableJsonNumbervalues were copied twice during parsing — once by the parser (ValueSpan.ToArray()) and again by the constructor (rawUtf8.ToArray()). Now usesFromOwnedto skip the redundant copy. - Number cloning: Same double-copy issue when cloning
MutableJsonNumbernodes viaMutableJsonMerge.Clone(). - Property name parsing: Every property name was allocated twice — once by the parser and again inside
Set(). A new internalSetOwnedmethod takes direct ownership of the byte array.
These fixes reduce allocations per parsed JSON document proportional to the number of numeric values and properties.
Documentation
- Added full VitePress documentation site at docs.cocoar.dev/json-mutable
- Added manual docs deployment workflow (
05-deploy-docs.yml) - Auto-deploy docs on stable release via
04-publish-stable.yml - Added path filters to PR validation and develop build workflows to skip unnecessary builds on documentation-only changes
Full Changelog: v1.0.0...v1.0.1
v1.0.0
Cocoar.Json.Mutable v1.0.0 - Initial Release
First stable release of Cocoar.Json.Mutable - a high-performance mutable JSON DOM optimized for efficient merging.
What's New
- Mutable JSON document object model with UTF-8 byte storage
- Efficient deep merge operations (
MergeandMergeDestructive) - Clone functionality for deep copying JSON nodes
- Core types:
MutableJsonObject,MutableJsonArray, and primitives - Parse and serialize using System.Text.Json
- Developer-friendly string API alongside UTF-8 byte API
- Support for
ReadOnlyMemory<byte>from data providers - 15 comprehensive unit tests
Installation
dotnet add package Cocoar.Json.MutableQuick Example
using Cocoar.Json.Mutable;
var config1 = MutableJsonDocument.Parse("{\"server\": {\"port\": 8080}}"u8);
var config2 = MutableJsonDocument.Parse("{\"server\": {\"host\": \"localhost\"}, \"debug\": true}"u8);
var result = new MutableJsonObject();
MutableJsonMerge.Merge(result, (MutableJsonObject)config1);
MutableJsonMerge.Merge(result, (MutableJsonObject)config2);
// Result: {"server": {"port": 8080, "host": "localhost"}, "debug": true}Notes
⚠️ Not thread-safe - use external synchronization for concurrent access- Built for .NET 8.0
- Perfect for configuration merging, API response aggregation, and JSON transformations
See the README for full documentation.