Categorygithub.com/dolmen-go/jsonptr-benchmark
modulepackage
0.0.0-20230425211450-48a293ff3dbb
Repository: https://github.com/dolmen-go/jsonptr-benchmark.git
Documentation: pkg.go.dev

# README

Benchmark for JSON Pointer (RFC 6901) implementations for Go

Tested implementations

Results

2023-04-25 (go1.20.3 darwin/amd64)

Get

Implspeedallocs bytesallocs count
dolmen-go/jsonptr601.9 ns/op16 B/op1 allocs/op
dustin/go-jsonpointer609.1 ns/op48 B/op1 allocs/op
go-openapi/jsonpointer3497 ns/op240 B/op8 allocs/op
json-validate/json-pointer-go1953 ns/op80 B/op2 allocs/op
lestrrat/go-jspointer2772 ns/op320 B/op9 allocs/op
mickep76/jsonptr1177 ns/op64 B/op1 allocs/op
oas3/jsonpointer1485 ns/op144 B/op3 allocs/op
qri-io/jsonpointer1893 ns/op48 B/op1 allocs/op
rnd42/go-jsonpointer1398 ns/op128 B/op3 allocs/op
twindagger/jsonptr2440 ns/op136 B/op3 allocs/op
xeipuuv/gojsonpointer1865 ns/op144 B/op3 allocs/op
yukithm/json2csv/jsonpointer4559 ns/op317 B/op17 allocs/op

Parse "/definitions/Location"

Implspeedallocs bytesallocs count
dolmen-go/jsonptr597.3 ns/op56 B/op2 allocs/op
go-openapi/jsonpointer1301 ns/op120 B/op4 allocs/op
json-validate/json-pointer-go1394 ns/op72 B/op2 allocs/op
lestrrat/go-jspointer1452 ns/op184 B/op4 allocs/op
oas3/jsonpointer852.8 ns/op56 B/op2 allocs/op
qri-io/jsonpointer2074 ns/op56 B/op2 allocs/op
rnd42/go-jsonpointer1586 ns/op120 B/op3 allocs/op
twindagger/jsonptr1742 ns/op104 B/op3 allocs/op
xeipuuv/gojsonpointer655.1 ns/op56 B/op2 allocs/op
yukithm/json2csv/jsonpointer2349 ns/op184 B/op9 allocs/op

Parse "/path/\~1home\~1dolmen"

Implspeedallocs bytesallocs count
dolmen-go/jsonptr1113 ns/op72 B/op3 allocs/op
go-openapi/jsonpointer1356 ns/op120 B/op4 allocs/op
json-validate/json-pointer-go1631 ns/op88 B/op3 allocs/op
lestrrat/go-jspointer1276 ns/op184 B/op4 allocs/op
oas3/jsonpointer841.8 ns/op56 B/op2 allocs/op
qri-io/jsonpointer1598 ns/op72 B/op3 allocs/op
rnd42/go-jsonpointer2972 ns/op136 B/op4 allocs/op
twindagger/jsonptr1892 ns/op120 B/op4 allocs/op
xeipuuv/gojsonpointer595.5 ns/op56 B/op2 allocs/op
yukithm/json2csv/jsonpointer3282 ns/op173 B/op9 allocs/op

Parse "/path/\~0\~1dolmen"

Implspeedallocs bytesallocs count
dolmen-go/jsonptr1243 ns/op64 B/op3 allocs/op
go-openapi/jsonpointer1325 ns/op120 B/op4 allocs/op
json-validate/json-pointer-go2009 ns/op96 B/op4 allocs/op
lestrrat/go-jspointer1108 ns/op176 B/op4 allocs/op
oas3/jsonpointer639.6 ns/op56 B/op2 allocs/op
qri-io/jsonpointer1705 ns/op80 B/op4 allocs/op
rnd42/go-jsonpointer3015 ns/op137 B/op5 allocs/op
twindagger/jsonptr4139 ns/op128 B/op5 allocs/op
xeipuuv/gojsonpointer1073 ns/op56 B/op2 allocs/op
yukithm/json2csv/jsonpointer3098 ns/op168 B/op9 allocs/op

BackToString "/definitions/Location"

Implspeedallocs bytesallocs count
dolmen-go/jsonptr550.7 ns/op72 B/op3 allocs/op
go-openapi/jsonpointer905.3 ns/op48 B/op2 allocs/op
json-validate/json-pointer-go2051 ns/op96 B/op4 allocs/op
lestrrat/go-jspointer66.05 ns/op0 B/op0 allocs/op
oas3/jsonpointer1244 ns/op64 B/op3 allocs/op
qri-io/jsonpointer1049 ns/op40 B/op2 allocs/op
rnd42/go-jsonpointer33.83 ns/op0 B/op0 allocs/op
twindagger/jsonptr2878 ns/op96 B/op4 allocs/op
xeipuuv/gojsonpointer901.4 ns/op48 B/op2 allocs/op
yukithm/json2csv/jsonpointer2000 ns/op112 B/op4 allocs/op

BackToString "/path/\~1home\~1dolmen"

Implspeedallocs bytesallocs count
dolmen-go/jsonptr646.4 ns/op64 B/op3 allocs/op
go-openapi/jsonpointer568.7 ns/op48 B/op2 allocs/op
json-validate/json-pointer-go1893 ns/op112 B/op5 allocs/op
lestrrat/go-jspointer38.75 ns/op0 B/op0 allocs/op
oas3/jsonpointer1197 ns/op64 B/op3 allocs/op
qri-io/jsonpointer1645 ns/op45 B/op3 allocs/op
rnd42/go-jsonpointer27.81 ns/op0 B/op0 allocs/op
twindagger/jsonptr1670 ns/op112 B/op5 allocs/op
xeipuuv/gojsonpointer625.3 ns/op48 B/op2 allocs/op
yukithm/json2csv/jsonpointer2057 ns/op176 B/op8 allocs/op

BackToString "/path/\~0\~1dolmen"

Implspeedallocs bytesallocs count
dolmen-go/jsonptr496.1 ns/op32 B/op2 allocs/op
go-openapi/jsonpointer499.1 ns/op32 B/op2 allocs/op
json-validate/json-pointer-go2283 ns/op112 B/op6 allocs/op
lestrrat/go-jspointer38.46 ns/op0 B/op0 allocs/op
oas3/jsonpointer1333 ns/op48 B/op3 allocs/op
qri-io/jsonpointer1686 ns/op48 B/op4 allocs/op
rnd42/go-jsonpointer35.97 ns/op0 B/op0 allocs/op
twindagger/jsonptr1656 ns/op112 B/op6 allocs/op
xeipuuv/gojsonpointer481.8 ns/op32 B/op2 allocs/op
yukithm/json2csv/jsonpointer2353 ns/op160 B/op8 allocs/op

ParseAndBackToString "/definitions/Location"

Implspeedallocs bytesallocs count
dolmen-go/jsonptr1556 ns/op128 B/op5 allocs/op
go-openapi/jsonpointer2027 ns/op168 B/op6 allocs/op
json-validate/json-pointer-go2254 ns/op168 B/op6 allocs/op
lestrrat/go-jspointer1383 ns/op184 B/op4 allocs/op
oas3/jsonpointer1963 ns/op120 B/op5 allocs/op
qri-io/jsonpointer2065 ns/op96 B/op4 allocs/op
rnd42/go-jsonpointer2092 ns/op120 B/op3 allocs/op
twindagger/jsonptr2350 ns/op200 B/op7 allocs/op
xeipuuv/gojsonpointer1536 ns/op104 B/op4 allocs/op
yukithm/json2csv/jsonpointer4762 ns/op296 B/op13 allocs/op

ParseAndBackToString "/path/\~1home\~1dolmen"

Implspeedallocs bytesallocs count
dolmen-go/jsonptr2407 ns/op136 B/op6 allocs/op
go-openapi/jsonpointer2122 ns/op168 B/op6 allocs/op
json-validate/json-pointer-go2850 ns/op200 B/op8 allocs/op
lestrrat/go-jspointer1625 ns/op184 B/op4 allocs/op
oas3/jsonpointer1931 ns/op120 B/op5 allocs/op
qri-io/jsonpointer2794 ns/op117 B/op6 allocs/op
rnd42/go-jsonpointer3168 ns/op137 B/op4 allocs/op
twindagger/jsonptr4816 ns/op232 B/op9 allocs/op
xeipuuv/gojsonpointer1651 ns/op104 B/op4 allocs/op
yukithm/json2csv/jsonpointer5676 ns/op349 B/op17 allocs/op

ParseAndBackToString "/path/\~0\~1dolmen"

Implspeedallocs bytesallocs count
dolmen-go/jsonptr2038 ns/op96 B/op5 allocs/op
go-openapi/jsonpointer1844 ns/op152 B/op6 allocs/op
json-validate/json-pointer-go3979 ns/op208 B/op10 allocs/op
lestrrat/go-jspointer1326 ns/op176 B/op4 allocs/op
oas3/jsonpointer2062 ns/op104 B/op5 allocs/op
qri-io/jsonpointer4250 ns/op136 B/op8 allocs/op
rnd42/go-jsonpointer3707 ns/op136 B/op5 allocs/op
twindagger/jsonptr5139 ns/op240 B/op11 allocs/op
xeipuuv/gojsonpointer1036 ns/op88 B/op4 allocs/op
yukithm/json2csv/jsonpointer4162 ns/op328 B/op17 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.

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Interfaces

same as fmt.Stringer.