Skip to content

[00026] Add ApplyPatch .NET wrapper and benchmarks for complete round-trip performance picture#11

Merged
rorychatt merged 1 commit into
mainfrom
plan-00026-Ivy.NativeJsonDiff
Apr 12, 2026
Merged

[00026] Add ApplyPatch .NET wrapper and benchmarks for complete round-trip performance picture#11
rorychatt merged 1 commit into
mainfrom
plan-00026-Ivy.NativeJsonDiff

Conversation

@rorychatt

Copy link
Copy Markdown
Collaborator

Summary

Added a .NET ApplyPatch wrapper around the existing Rust FFI rustserver_apply_patch function, along with 6 unit tests and a new JsonApplyBenchmarks benchmark class that compares apply/patch performance across NativeJsonDiff, JsonDiffPatch.Net, and SystemTextJson.JsonDiffPatch.

API Changes

  • Added NativeJsonDiff.ApplyPatch(byte[] jsonBytes, byte[] patchBytes) — applies an RFC 6902 JSON patch to a document via the Rust native library and returns the resulting JsonNode?
  • Added JsonApplyBenchmarks benchmark class with NativeJsonDiff(), JsonDiffPatchNet(), and SystemTextJsonDiffPatch() benchmark methods across 8 payload categories

Files Modified

  • Wrapper: src/Ivy.NativeJsonDiff/NativeJsonDiff.cs — added rustserver_apply_patch DllImport and public ApplyPatch method
  • Tests: src/Ivy.NativeJsonDiff.Tests/NativeJsonDiffTests.cs — added 6 ApplyPatch tests (replace, add, remove, empty patch, null input, round-trip)
  • Benchmarks: src/Ivy.NativeJsonDiff.Benchmarks/Benchmarks/JsonApplyBenchmarks.cs (new) — apply benchmarks comparing 3 libraries

Commits

  • b0cf716 [00026] Add ApplyPatch .NET wrapper, tests, and apply benchmarks

@rorychatt
rorychatt merged commit 804c3d1 into main Apr 12, 2026
2 checks passed
@rorychatt
rorychatt deleted the plan-00026-Ivy.NativeJsonDiff branch April 12, 2026 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant