Benchmark for JSON Pointer (RFC 6901) implementations for Go
Tested implementations
Results
2026-09-22 (go1.27.0 linux/amd64)
Versions tested are in go.mod.
| Impl |
speed |
allocs bytes |
allocs count |
| Jeffail/gabs/v2 |
246.7 ns/op |
165 B/op |
10 allocs/op |
| chanced/jsonpointer |
601.2 ns/op |
165 B/op |
13 allocs/op |
| crhntr/jsonschema/jsonptr |
487.1 ns/op |
80 B/op |
6 allocs/op |
| dolmen-go/jsonptr |
60.93 ns/op |
16 B/op |
1 allocs/op |
| dustin/go-jsonpointer |
84.24 ns/op |
48 B/op |
1 allocs/op |
| go-openapi/jsonpointer |
398.0 ns/op |
277 B/op |
15 allocs/op |
| json-validate/json-pointer-go |
145.4 ns/op |
80 B/op |
2 allocs/op |
| kaptinlin/jsonpointer |
136.6 ns/op |
96 B/op |
2 allocs/op |
| lestrrat-go/jspointer |
282.1 ns/op |
320 B/op |
9 allocs/op |
| mickep76/jsonptr |
151.9 ns/op |
64 B/op |
1 allocs/op |
| oas3/jsonpointer |
180.8 ns/op |
144 B/op |
3 allocs/op |
| qri-io/jsonpointer |
128.9 ns/op |
48 B/op |
1 allocs/op |
| rnd42/go-jsonpointer |
213.6 ns/op |
129 B/op |
3 allocs/op |
| twindagger/jsonptr |
169.3 ns/op |
136 B/op |
3 allocs/op |
| xeipuuv/gojsonpointer |
174.3 ns/op |
144 B/op |
3 allocs/op |
| yukithm/json2csv/jsonpointer |
445.1 ns/op |
317 B/op |
17 allocs/op |
| Impl |
speed |
allocs bytes |
allocs count |
| Jeffail/gabs/v2 |
1951 ns/op |
1099 B/op |
30 allocs/op |
| crhntr/jsonschema/jsonptr |
1732 ns/op |
1248 B/op |
20 allocs/op |
| dolmen-go/jsonptr |
1216 ns/op |
712 B/op |
21 allocs/op |
| dustin/go-jsonpointer |
784.0 ns/op |
552 B/op |
13 allocs/op |
Parse "/definitions/Location"
| Impl |
speed |
allocs bytes |
allocs count |
| chanced/jsonpointer |
27.01 ns/op |
16 B/op |
1 allocs/op |
| crhntr/jsonschema/jsonptr |
37.67 ns/op |
16 B/op |
1 allocs/op |
| dolmen-go/jsonptr |
53.95 ns/op |
56 B/op |
2 allocs/op |
| encoding/json/jsontext |
34.92 ns/op |
16 B/op |
1 allocs/op |
| go-openapi/jsonpointer |
88.62 ns/op |
104 B/op |
3 allocs/op |
| json-validate/json-pointer-go |
109.6 ns/op |
72 B/op |
2 allocs/op |
| kaptinlin/jsonpointer |
97.58 ns/op |
88 B/op |
3 allocs/op |
| lestrrat-go/jspointer |
157.3 ns/op |
184 B/op |
4 allocs/op |
| oas3/jsonpointer |
47.82 ns/op |
56 B/op |
2 allocs/op |
| qri-io/jsonpointer |
102.8 ns/op |
56 B/op |
2 allocs/op |
| rnd42/go-jsonpointer |
179.8 ns/op |
121 B/op |
3 allocs/op |
| twindagger/jsonptr |
130.4 ns/op |
104 B/op |
3 allocs/op |
| xeipuuv/gojsonpointer |
48.91 ns/op |
56 B/op |
2 allocs/op |
| yukithm/json2csv/jsonpointer |
202.8 ns/op |
184 B/op |
9 allocs/op |
Parse "/path/\~1home\~1dolmen"
| Impl |
speed |
allocs bytes |
allocs count |
| chanced/jsonpointer |
31.92 ns/op |
16 B/op |
1 allocs/op |
| crhntr/jsonschema/jsonptr |
35.78 ns/op |
16 B/op |
1 allocs/op |
| dolmen-go/jsonptr |
100.1 ns/op |
72 B/op |
3 allocs/op |
| encoding/json/jsontext |
38.09 ns/op |
16 B/op |
1 allocs/op |
| go-openapi/jsonpointer |
85.11 ns/op |
104 B/op |
3 allocs/op |
| json-validate/json-pointer-go |
166.0 ns/op |
88 B/op |
3 allocs/op |
| kaptinlin/jsonpointer |
135.8 ns/op |
104 B/op |
4 allocs/op |
| lestrrat-go/jspointer |
158.0 ns/op |
184 B/op |
4 allocs/op |
| oas3/jsonpointer |
48.19 ns/op |
56 B/op |
2 allocs/op |
| qri-io/jsonpointer |
164.0 ns/op |
72 B/op |
3 allocs/op |
| rnd42/go-jsonpointer |
300.4 ns/op |
137 B/op |
4 allocs/op |
| twindagger/jsonptr |
185.8 ns/op |
120 B/op |
4 allocs/op |
| xeipuuv/gojsonpointer |
48.11 ns/op |
56 B/op |
2 allocs/op |
| yukithm/json2csv/jsonpointer |
238.2 ns/op |
173 B/op |
9 allocs/op |
Parse "/path/\~0\~1dolmen"
| Impl |
speed |
allocs bytes |
allocs count |
| chanced/jsonpointer |
31.98 ns/op |
16 B/op |
1 allocs/op |
| crhntr/jsonschema/jsonptr |
35.92 ns/op |
16 B/op |
1 allocs/op |
| dolmen-go/jsonptr |
96.25 ns/op |
64 B/op |
3 allocs/op |
| encoding/json/jsontext |
43.69 ns/op |
16 B/op |
1 allocs/op |
| go-openapi/jsonpointer |
92.99 ns/op |
104 B/op |
3 allocs/op |
| json-validate/json-pointer-go |
226.6 ns/op |
96 B/op |
4 allocs/op |
| kaptinlin/jsonpointer |
148.7 ns/op |
104 B/op |
4 allocs/op |
| lestrrat-go/jspointer |
147.3 ns/op |
176 B/op |
4 allocs/op |
| oas3/jsonpointer |
52.59 ns/op |
56 B/op |
2 allocs/op |
| qri-io/jsonpointer |
200.5 ns/op |
80 B/op |
4 allocs/op |
| rnd42/go-jsonpointer |
342.0 ns/op |
137 B/op |
5 allocs/op |
| twindagger/jsonptr |
221.5 ns/op |
128 B/op |
5 allocs/op |
| xeipuuv/gojsonpointer |
47.65 ns/op |
56 B/op |
2 allocs/op |
| yukithm/json2csv/jsonpointer |
287.5 ns/op |
168 B/op |
9 allocs/op |
| Impl |
speed |
allocs bytes |
allocs count |
| chanced/jsonpointer |
4.294 ns/op |
0 B/op |
0 allocs/op |
| crhntr/jsonschema/jsonptr |
4.419 ns/op |
0 B/op |
0 allocs/op |
| dolmen-go/jsonptr |
66.28 ns/op |
56 B/op |
2 allocs/op |
| encoding/json/jsontext |
4.345 ns/op |
0 B/op |
0 allocs/op |
| go-openapi/jsonpointer |
68.76 ns/op |
48 B/op |
2 allocs/op |
| json-validate/json-pointer-go |
161.8 ns/op |
64 B/op |
3 allocs/op |
| kaptinlin/jsonpointer |
77.24 ns/op |
24 B/op |
1 allocs/op |
| lestrrat-go/jspointer |
4.178 ns/op |
0 B/op |
0 allocs/op |
| oas3/jsonpointer |
114.8 ns/op |
64 B/op |
3 allocs/op |
| qri-io/jsonpointer |
108.7 ns/op |
40 B/op |
2 allocs/op |
| rnd42/go-jsonpointer |
3.962 ns/op |
0 B/op |
0 allocs/op |
| twindagger/jsonptr |
163.9 ns/op |
64 B/op |
3 allocs/op |
| xeipuuv/gojsonpointer |
66.95 ns/op |
48 B/op |
2 allocs/op |
| yukithm/json2csv/jsonpointer |
152.4 ns/op |
112 B/op |
4 allocs/op |
BackToString "/path/\~1home\~1dolmen"
| Impl |
speed |
allocs bytes |
allocs count |
| chanced/jsonpointer |
4.018 ns/op |
0 B/op |
0 allocs/op |
| crhntr/jsonschema/jsonptr |
3.951 ns/op |
0 B/op |
0 allocs/op |
| dolmen-go/jsonptr |
83.82 ns/op |
48 B/op |
2 allocs/op |
| encoding/json/jsontext |
3.947 ns/op |
0 B/op |
0 allocs/op |
| go-openapi/jsonpointer |
67.38 ns/op |
48 B/op |
2 allocs/op |
| json-validate/json-pointer-go |
195.8 ns/op |
80 B/op |
4 allocs/op |
| kaptinlin/jsonpointer |
120.3 ns/op |
48 B/op |
2 allocs/op |
| lestrrat-go/jspointer |
4.090 ns/op |
0 B/op |
0 allocs/op |
| oas3/jsonpointer |
111.7 ns/op |
64 B/op |
3 allocs/op |
| qri-io/jsonpointer |
148.0 ns/op |
45 B/op |
3 allocs/op |
| rnd42/go-jsonpointer |
3.991 ns/op |
0 B/op |
0 allocs/op |
| twindagger/jsonptr |
198.5 ns/op |
80 B/op |
4 allocs/op |
| xeipuuv/gojsonpointer |
67.30 ns/op |
48 B/op |
2 allocs/op |
| yukithm/json2csv/jsonpointer |
222.0 ns/op |
144 B/op |
6 allocs/op |
| Impl |
speed |
allocs bytes |
allocs count |
| chanced/jsonpointer |
3.895 ns/op |
0 B/op |
0 allocs/op |
| crhntr/jsonschema/jsonptr |
3.866 ns/op |
0 B/op |
0 allocs/op |
| dolmen-go/jsonptr |
53.26 ns/op |
16 B/op |
1 allocs/op |
| encoding/json/jsontext |
3.912 ns/op |
0 B/op |
0 allocs/op |
| go-openapi/jsonpointer |
64.16 ns/op |
32 B/op |
2 allocs/op |
| json-validate/json-pointer-go |
215.1 ns/op |
80 B/op |
5 allocs/op |
| kaptinlin/jsonpointer |
102.7 ns/op |
32 B/op |
2 allocs/op |
| lestrrat-go/jspointer |
4.229 ns/op |
0 B/op |
0 allocs/op |
| oas3/jsonpointer |
111.8 ns/op |
48 B/op |
3 allocs/op |
| qri-io/jsonpointer |
167.5 ns/op |
53 B/op |
4 allocs/op |
| rnd42/go-jsonpointer |
3.784 ns/op |
0 B/op |
0 allocs/op |
| twindagger/jsonptr |
209.4 ns/op |
80 B/op |
5 allocs/op |
| xeipuuv/gojsonpointer |
63.93 ns/op |
32 B/op |
2 allocs/op |
| yukithm/json2csv/jsonpointer |
198.3 ns/op |
128 B/op |
6 allocs/op |
| Impl |
speed |
allocs bytes |
allocs count |
| chanced/jsonpointer |
30.18 ns/op |
16 B/op |
1 allocs/op |
| crhntr/jsonschema/jsonptr |
41.57 ns/op |
16 B/op |
1 allocs/op |
| dolmen-go/jsonptr |
121.6 ns/op |
112 B/op |
4 allocs/op |
| encoding/json/jsontext |
39.63 ns/op |
16 B/op |
1 allocs/op |
| go-openapi/jsonpointer |
164.6 ns/op |
152 B/op |
5 allocs/op |
| json-validate/json-pointer-go |
274.6 ns/op |
136 B/op |
5 allocs/op |
| kaptinlin/jsonpointer |
176.8 ns/op |
112 B/op |
4 allocs/op |
| lestrrat-go/jspointer |
153.8 ns/op |
184 B/op |
4 allocs/op |
| oas3/jsonpointer |
163.4 ns/op |
120 B/op |
5 allocs/op |
| qri-io/jsonpointer |
215.0 ns/op |
96 B/op |
4 allocs/op |
| rnd42/go-jsonpointer |
182.2 ns/op |
121 B/op |
3 allocs/op |
| twindagger/jsonptr |
302.2 ns/op |
168 B/op |
6 allocs/op |
| xeipuuv/gojsonpointer |
116.7 ns/op |
104 B/op |
4 allocs/op |
| yukithm/json2csv/jsonpointer |
391.3 ns/op |
296 B/op |
13 allocs/op |
| Impl |
speed |
allocs bytes |
allocs count |
| chanced/jsonpointer |
34.93 ns/op |
16 B/op |
1 allocs/op |
| crhntr/jsonschema/jsonptr |
39.48 ns/op |
16 B/op |
1 allocs/op |
| dolmen-go/jsonptr |
200.0 ns/op |
120 B/op |
5 allocs/op |
| encoding/json/jsontext |
43.24 ns/op |
16 B/op |
1 allocs/op |
| go-openapi/jsonpointer |
170.4 ns/op |
152 B/op |
5 allocs/op |
| json-validate/json-pointer-go |
397.7 ns/op |
168 B/op |
7 allocs/op |
| kaptinlin/jsonpointer |
287.4 ns/op |
152 B/op |
6 allocs/op |
| lestrrat-go/jspointer |
159.5 ns/op |
184 B/op |
4 allocs/op |
| oas3/jsonpointer |
179.1 ns/op |
120 B/op |
5 allocs/op |
| qri-io/jsonpointer |
342.3 ns/op |
117 B/op |
6 allocs/op |
| rnd42/go-jsonpointer |
323.3 ns/op |
137 B/op |
4 allocs/op |
| twindagger/jsonptr |
427.8 ns/op |
200 B/op |
8 allocs/op |
| xeipuuv/gojsonpointer |
119.5 ns/op |
104 B/op |
4 allocs/op |
| yukithm/json2csv/jsonpointer |
520.2 ns/op |
317 B/op |
15 allocs/op |
| Impl |
speed |
allocs bytes |
allocs count |
| chanced/jsonpointer |
32.56 ns/op |
16 B/op |
1 allocs/op |
| crhntr/jsonschema/jsonptr |
36.36 ns/op |
16 B/op |
1 allocs/op |
| dolmen-go/jsonptr |
167.6 ns/op |
80 B/op |
4 allocs/op |
| encoding/json/jsontext |
41.67 ns/op |
16 B/op |
1 allocs/op |
| go-openapi/jsonpointer |
166.3 ns/op |
136 B/op |
5 allocs/op |
| json-validate/json-pointer-go |
441.0 ns/op |
176 B/op |
9 allocs/op |
| kaptinlin/jsonpointer |
248.1 ns/op |
136 B/op |
6 allocs/op |
| lestrrat-go/jspointer |
150.9 ns/op |
176 B/op |
4 allocs/op |
| oas3/jsonpointer |
168.3 ns/op |
104 B/op |
5 allocs/op |
| qri-io/jsonpointer |
376.3 ns/op |
136 B/op |
8 allocs/op |
| rnd42/go-jsonpointer |
340.3 ns/op |
137 B/op |
5 allocs/op |
| twindagger/jsonptr |
489.5 ns/op |
208 B/op |
10 allocs/op |
| xeipuuv/gojsonpointer |
114.7 ns/op |
88 B/op |
4 allocs/op |
| yukithm/json2csv/jsonpointer |
465.5 ns/op |
296 B/op |
15 allocs/op |
Run
go test -bench . -benchmem | tee bench.txt
perl ./bench-to-table.pl < bench.txt > bench.md
License
Copyright 2016-2021 Olivier Mengué
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.