Havunen / SystemTextJsonPatch

SystemTextJsonPatch is a JSON Patch (JsonPatchDocument) RFC 6902 implementation for .NET using System.Text.Json
MIT License
102 stars 12 forks source link

User JsonReader directly for parsing operations #9

Closed campersau closed 2 years ago

campersau commented 2 years ago
Method Mean Error StdDev Median Gen 0 Allocated
SystemTextJsonPatch_base 14.78 us 0.406 us 1.189 us 14.16 us 0.3967 5 KB
SystemTextJsonPatch_pr 10.12 us 0.192 us 0.509 us 9.887 us 0.2747 4 KB

If we don't ignore the casing of the propertynames (op, path, from, value) we could reduce it by another us and safe an additional KB. But the other implementations also ignore the casing so I haven't changed that. FYI there aren't currently any tests which check that the casing is ignored.

Havunen commented 2 years ago

Nice improvement! :)

If we don't ignore the casing of the propertynames (op, path, from, value) we could reduce it by another us and safe an additional KB. But the other implementations also ignore the casing so I haven't changed that. FYI there aren't currently any tests which check that the casing is ignored.

Maybe this package should actually follow System.Text.Json JsonSerializerOptions.PropertyNameCaseInsensitive flag