Boeing / config-file-validator

Cross Platform tool to validate configuration files
https://boeing.github.io/config-file-validator/
Apache License 2.0
324 stars 55 forks source link

small optimization for fsfinder #136

Closed SkobelkinYaroslav closed 1 month ago

SkobelkinYaroslav commented 5 months ago

some optimization and added benchmark to test it

kehoecj commented 4 months ago

Output of the benchmark run go test -v --bench=Benchmark_Finder -benchtime 5s -benchmem ./...

goos: darwin
goarch: amd64
pkg: github.com/Boeing/config-file-validator/pkg/finder
cpu: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Benchmark_Finder
Benchmark_Finder-12         6346        823069 ns/op       75869 B/op        628 allocs/op

and here's the benchmark against the main branch finder:

goos: darwin
goarch: amd64
pkg: github.com/Boeing/config-file-validator/pkg/finder
cpu: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Benchmark_Finder
Benchmark_Finder-12         7038        769833 ns/op       79535 B/op        634 allocs/op

Some pretty clear improvements. Thanks @SkobelkinYaroslav !