Improved JSON decoding (improves arduino-cli startup time) (#1402)
* Updated library_index.json for testing * Use easyjson for parsing library_index * Added benchmarks for json deconding. Results: $ go test -v -benchmem -bench BenchmarkIndexParsing github.com/arduino/arduino-cli/arduino/libraries/librariesindex === RUN TestIndexer --- PASS: TestIndexer (0.16s) goos: linux goarch: amd64 pkg: github.com/arduino/arduino-cli/arduino/libraries/librariesindex cpu: Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz BenchmarkIndexParsingStdJSON BenchmarkIndexParsingStdJSON-8 5 214872730 ns/op 94.52 MB/s 58956539 B/op 418973 allocs/op BenchmarkIndexParsingEasyJSON BenchmarkIndexParsingEasyJSON-8 16 69215472 ns/op 293.42 MB/s 56162664 B/op 418966 allocs/op PASS ok github.com/arduino/arduino-cli/arduino/libraries/librariesindex 4.442s easyjson is 3x faster. * Updated license check cache * Added easyjson to package_index.json parser * Allow easyjson to match tags in case-insensitive See https://github.com/mailru/easyjson/pull/372 * Added easyjson generation task in Taskfile * Added github action check * Update .github/workflows/check-easyjson.yml Co-authored-by: per1234 <accounts@perglass.com> Co-authored-by: per1234 <accounts@perglass.com>
Showing
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
... | ... | @@ -2,6 +2,9 @@ module github.com/arduino/arduino-cli |
go 1.17 | ||
// We must use this fork until https://github.com/mailru/easyjson/pull/372 is merged | ||
replace github.com/mailru/easyjson => github.com/cmaglie/easyjson v0.8.1 | ||
require ( | ||
github.com/arduino/board-discovery v0.0.0-20180823133458-1ba29327fb0c | ||
github.com/arduino/go-paths-helper v1.7.0 | ||
... | ... | @@ -19,6 +22,7 @@ require ( |
github.com/juju/loggo v0.0.0-20190526231331-6e530bcce5d8 // indirect | ||
github.com/kr/text v0.2.0 // indirect | ||
github.com/leonelquinteros/gotext v1.4.0 | ||
github.com/mailru/easyjson v0.7.7 | ||
github.com/marcinbor85/gohex v0.0.0-20210308104911-55fb1c624d84 | ||
github.com/mattn/go-colorable v0.1.8 | ||
github.com/mattn/go-isatty v0.0.12 | ||
... | ... | @@ -62,6 +66,7 @@ require ( |
github.com/hashicorp/hcl v1.0.0 // indirect | ||
github.com/inconshreveable/mousetrap v1.0.0 // indirect | ||
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect | ||
github.com/josharian/intern v1.0.0 // indirect | ||
github.com/juju/errors v0.0.0-20181118221551-089d3ea4e4d5 // indirect | ||
github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd // indirect | ||
github.com/konsorten/go-windows-terminal-sequences v1.0.1 // indirect | ||
... | ... |
Please register or sign in to comment