-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.bazelrc: enable skymeld by default #4411
Conversation
Skymeld config helps us start build actions without having to wait for all repository rules to finish executing in Analysis phase. Effectively, this let us start the frontend builds earlier without having to wait for the Go external dependencies and toolchain to finish loading. Some benchmarks 1. Building `//server` without remote cache ```bash > hyperfine --prepare 'bazel clean --async' \ --warmup 1 \ 'bazel build --config=x -k --remote_instance_name="$RANDOM" server' \ 'bazel build --config=x -k --remote_instance_name="$RANDOM" --config=skymeld server' Benchmark 1: bazel build --config=x -k --remote_instance_name="$RANDOM" server Time (mean ± σ): 241.279 s ± 42.673 s [User: 0.134 s, System: 0.149 s] Range (min … max): 169.694 s … 318.005 s 10 runs Benchmark 2: bazel build --config=x -k --remote_instance_name="$RANDOM" --config=skymeld server Time (mean ± σ): 213.551 s ± 75.335 s [User: 0.118 s, System: 0.129 s] Range (min … max): 148.260 s … 400.258 s 10 runs Summary bazel build --config=x -k --remote_instance_name="$RANDOM" --config=skymeld server ran 1.13 ± 0.45 times faster than bazel build --config=x -k --remote_instance_name="$RANDOM" server ``` 2. Building `//server` with remote cache ```bash > hyperfine --prepare 'bazel clean --async' \ --warmup 1 \ 'bazel build --config=x -k server' \ 'bazel build --config=x -k --config=skymeld server' Benchmark 1: bazel build --config=x -k server Time (mean ± σ): 19.282 s ± 0.473 s [User: 0.014 s, System: 0.023 s] Range (min … max): 18.656 s … 20.218 s 10 runs Benchmark 2: bazel build --config=x -k --config=skymeld server Time (mean ± σ): 17.732 s ± 0.407 s [User: 0.014 s, System: 0.023 s] Range (min … max): 17.118 s … 18.626 s 10 runs Summary bazel build --config=x -k --config=skymeld server ran 1.09 ± 0.04 times faster than bazel build --config=x -k server ``` 3. Testing everything with remote cache ```bash > hyperfine --prepare 'bazel clean --async' \ --warmup 1 \ 'bazel build --config=x -k //...' \ 'bazel build --config=x -k --config=skymeld //...' Benchmark 1: bazel build --config=x -k //... Time (mean ± σ): 27.113 s ± 1.020 s [User: 0.014 s, System: 0.020 s] Range (min … max): 25.938 s … 28.833 s 10 runs Benchmark 2: bazel build --config=x -k --config=skymeld //... Time (mean ± σ): 25.349 s ± 1.155 s [User: 0.014 s, System: 0.021 s] Range (min … max): 23.567 s … 27.314 s 10 runs Summary bazel build --config=x -k --config=skymeld //... ran 1.07 ± 0.06 times faster than bazel build --config=x -k //... ``` Overall, using Skymeld gives a +7-14% speed improvement over the existing setup. Removed `--experimental_skymeld_ui` as it's a no-op flag.
IIUC skymeld is only expected to speed up multi-target builds so it's interesting that it has any effect for bazelbuild/bazel#14057 (comment)
I'm wondering if this could be due to either the Do you get the same results if you swap the order of the 2 build commands? i.e. instead of
do
(Small side note, you could omit |
Another thing that's mildly concerning is the relatively high max time (400s) with skymeld enabled, vs 318s disabled (for the |
I think it affects both. It was first implemented as a POC for a single target build and later on, expanded to support multi-targets build. In practice, this implementation starts in BuildTool.java where the logic is something like this
However, it will have more impact with build graphs that have a more fine-grained analysis phase vs clustered up. The reason why I think
AFAIK,
I don't have a good solution for this other than bumping up run counts in hyperfine and accepting a certain margin of error 🤔
Will try this out.
Agree. I was using it during some exploratory runs prior. Probably don't need it for the real benchmark.
Good point. I think the overall spikes were likely due to my local network condition. I'm thinking of 3 ways to improve the general benchmarking methodology:
|
This is the default as of Bazel 7. |
Skymeld config helps us start build actions without having to wait for
all repository rules to finish executing in Analysis phase.
Effectively, this let us start the frontend builds earlier without
having to wait for the Go external dependencies and toolchain to finish
loading.
Some benchmarks
Building
//server
without remote cacheBuilding
//server
with remote cacheTesting everything with remote cache
Overall, using Skymeld gives a +7-14% speed improvement over the
existing setup.
Removed
--experimental_skymeld_ui
as it's a no-op flag.Related issues: N/A