Skip to content

Commit 45186ed

Browse files
committed
(hackily) remove inefficient optimization
``` name old time/op new time/op delta CreatePatch/complex-48 167µs ± 8% 156µs ± 4% -6.85% (p=0.001 n=10+10) CreatePatch/large_array-48 664ms ± 1% 2ms ± 3% -99.71% (p=0.000 n=10+10) CreatePatch/simple-48 2.95µs ± 2% 2.92µs ± 1% ~ (p=0.447 n=10+10) name old alloc/op new alloc/op delta CreatePatch/complex-48 75.8kB ± 0% 75.0kB ± 0% -0.95% (p=0.000 n=10+10) CreatePatch/large_array-48 153MB ± 0% 1MB ± 0% -99.39% (p=0.000 n=9+10) CreatePatch/simple-48 1.23kB ± 0% 1.23kB ± 0% +0.04% (p=0.033 n=10+10) name old allocs/op new allocs/op delta CreatePatch/complex-48 1.20k ± 0% 1.17k ± 0% -2.41% (p=0.000 n=10+10) CreatePatch/large_array-48 7.01M ± 0% 0.01M ± 0% -99.79% (p=0.000 n=10+10) CreatePatch/simple-48 29.0 ± 0% 29.0 ± 0% ~ (all equal) ``` Signed-off-by: John Howard <[email protected]>
1 parent e0f6c24 commit 45186ed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

v2/jsonpatch.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ func handleValues(av, bv interface{}, p string, patch []Operation) ([]Operation,
214214
}
215215
case []interface{}:
216216
bt := bv.([]interface{})
217-
if isSimpleArray(at) && isSimpleArray(bt) {
217+
if false && isSimpleArray(at) && isSimpleArray(bt) {
218218
patch = append(patch, compareEditDistance(at, bt, p)...)
219219
} else {
220220
n := min(len(at), len(bt))

0 commit comments

Comments
 (0)