Pull Requests | Issues | v2.50.0...v2.50.1
Improve the performance of command execution
This release improves the performance of aqua which
and aqua exec
command.
aqua which
read registries, but the standard registry is very large (about 2MB) so it makes the performance worse.
Furthermore, the standard registry gets larger every time we improve the standard registry.
To solve the problem, this pull request introduces the cache mechanism of packages by aqua.yaml.
aqua creates a cache file per aqua.yaml into $(aqua root-dir)/registry-cache/<base64 encoded aqua.yaml absolute path>.json
.
The structure of cache files is:
{
"absolute path of registry.yaml": {
"package name": {
"type": "github_release",
// ...
}
}
}
If a registry type is local
, a cache file isn't created.
Cache files are much smaller than the standard registry, so aqua can read them much faster.
If packages aren't found in cache files, aqua reads the original registries and updates cache files.
aqua removes unused records from cache.
Bench mark
$ hyperfine --warmup 3 "/Users/shunsukesuzuki/go/bin/aqua which golangci-lint" "/Users/shunsukesuzuki/.local/share/aquaproj-aqua/internal/pkgs/github_release/github.com/aquaproj/aqua/v2.50.1-1/aqua_darwin_arm64.tar.gz/aqua which golangci-lint" "/Users/shunsukesuzuki/.local/share/aquaproj-aqua/internal/pkgs/github_release/github.com/aquaproj/aqua/v2.50.0/aqua_darwin_arm64.tar.gz/aqua which golangci-lint"
Benchmark 1: /Users/shunsukesuzuki/go/bin/aqua which golangci-lint
Time (mean ± σ): 25.0 ms ± 3.5 ms [User: 21.4 ms, System: 3.7 ms]
Range (min … max): 21.6 ms … 45.4 ms 77 runs
Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options.
Benchmark 2: /Users/shunsukesuzuki/.local/share/aquaproj-aqua/internal/pkgs/github_release/github.com/aquaproj/aqua/v2.50.1-1/aqua_darwin_arm64.tar.gz/aqua which golangci-lint
Time (mean ± σ): 41.7 ms ± 4.5 ms [User: 41.1 ms, System: 5.3 ms]
Range (min … max): 37.2 ms … 62.3 ms 55 runs
Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options.
Benchmark 3: /Users/shunsukesuzuki/.local/share/aquaproj-aqua/internal/pkgs/github_release/github.com/aquaproj/aqua/v2.50.0/aqua_darwin_arm64.tar.gz/aqua which golangci-lint
Time (mean ± σ): 42.8 ms ± 4.0 ms [User: 41.9 ms, System: 5.6 ms]
Range (min … max): 39.4 ms … 55.4 ms 43 runs
Warning: The first benchmarking run for this command was significantly slower than the rest (54.4 ms). This could be caused by (filesystem) caches that were not filled until after the first run. You are already using the '--warmup' option which helps to fill these caches before the actual benchmark. You can either try to increase the warmup count further or re-run this benchmark on a quiet system in case it was a random outlier. Alternatively, consider using the '--prepare' option to clear the caches before each timing run.
Summary
/Users/shunsukesuzuki/go/bin/aqua which golangci-lint ran
1.67 ± 0.29 times faster than /Users/shunsukesuzuki/.local/share/aquaproj-aqua/internal/pkgs/github_release/github.com/aquaproj/aqua/v2.50.1-1/aqua_darwin_arm64.tar.gz/aqua which golangci-lint
1.71 ± 0.29 times faster than /Users/shunsukesuzuki/.local/share/aquaproj-aqua/internal/pkgs/github_release/github.com/aquaproj/aqua/v2.50.0/aqua_darwin_arm64.tar.gz/aqua which golangci-lint
Others
#3840 chore: update aqua-proxy to v1.2.9
#3839 chore: update urfave-cli-v3-util to v0.0.4