Closed g4s8 closed 3 years ago
Benchmark results on my laptop:
$ go test -bench="BenchmarkDetect$" ./licensedb -run=BenchmarkDetect
goos: linux
goarch: amd64
pkg: github.com/go-enry/go-license-detector/v4/licensedb
cpu: Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
BenchmarkDetect-12 1 2183395428 ns/op
PASS
ok github.com/go-enry/go-license-detector/v4/licensedb 2.344s
$ go test -bench="BenchmarkDetectWithPreload$" ./licensedb -run=BenchmarkDetectWithPreload
goos: linux
goarch: amd64
pkg: github.com/go-enry/go-license-detector/v4/licensedb
cpu: Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
BenchmarkDetectWithPreload-12 76 15373506 ns/op
PASS
ok github.com/go-enry/go-license-detector/v4/licensedb 3.444s
@bzz could you please check this PR?
@bzz hi, any chance to review this PR?
LGTM, sans a minor API doc clarification.
Windows test failures have nothing to do with the change.
Thank you for adding this!
@bzz thanks, fixed in the last commit https://github.com/go-enry/go-license-detector/pull/14/commits/6403a23e656acb8434697c4bdcd4720ec2e209a1
Fixes #13 - added preload method to initialize database without performing any license check. Added two benchmarks to compare the difference between calls with and without preload.