We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7b8895c commit 174e1d7Copy full SHA for 174e1d7
v5/bench_test.go
@@ -0,0 +1,18 @@
1
+package jsonpatch
2
+
3
+import "testing"
4
5
+func BenchmarkMergePatch(b *testing.B) {
6
+ original := []byte(`{"name": "John", "age": 24, "height": 3.21}`)
7
+ target := []byte(`{"name": "Jane", "age": 24}`)
8
+ alternative := []byte(`{"name": "Tina", "age": 28, "height": 3.75}`)
9
10
+ patch, err := CreateMergePatch(original, target)
11
+ if err != nil {
12
+ panic(err)
13
+ }
14
15
+ for n := 0; n < b.N; n++ {
16
+ MergePatch(alternative, patch)
17
18
+}
0 commit comments