Skip to content

Commit

Permalink
(hackily) remove inefficient optimization
Browse files Browse the repository at this point in the history
```
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]>
  • Loading branch information
howardjohn committed May 16, 2023
1 parent e0f6c24 commit 45186ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion v2/jsonpatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ func handleValues(av, bv interface{}, p string, patch []Operation) ([]Operation,
}
case []interface{}:
bt := bv.([]interface{})
if isSimpleArray(at) && isSimpleArray(bt) {
if false && isSimpleArray(at) && isSimpleArray(bt) {
patch = append(patch, compareEditDistance(at, bt, p)...)
} else {
n := min(len(at), len(bt))
Expand Down

0 comments on commit 45186ed

Please sign in to comment.