While we're transitioning to Bazel, we're automatically generating our BUILD and WORKSPACE files from other sources.
I'm a bit surprised to see that the Bazel build gets a lot slower when we regenerate/touch the BUILD/WORKSPACE files, even when the files themselves are unchanged.
Is this expected? I feel like I'm going to work around it by making my generator skip writing the file if it's not changing anything.
$ bazel clean
INFO: Starting clean (this may take a while). Consider using --expunge_async if the clean takes more than several minutes.
$ bazel build //:x
INFO: Found 1 target...
Target //:x up-to-date:
bazel-bin/libx.jar
INFO: Elapsed time: 11.058s, Critical Path: 7.72s
$ bazel build //:x
INFO: Found 1 target...
Target //:x up-to-date:
bazel-bin/libx.jar
INFO: Elapsed time: 0.167s, Critical Path: 0.00s
$ bazel build //:x
INFO: Found 1 target...
Target //:x up-to-date:
bazel-bin/libx.jar
INFO: Elapsed time: 0.153s, Critical Path: 0.00s
$ touch BUILD
$ bazel build //:x
INFO: Found 1 target...
Target //:x up-to-date:
bazel-bin/libx.jar
INFO: Elapsed time: 1.546s, Critical Path: 0.19s
$ touch BUILD
$ bazel build //:x
INFO: Found 1 target...
Target //:x up-to-date:
bazel-bin/libx.jar
INFO: Elapsed time: 1.562s, Critical Path: 0.19s
$ touch WORKSPACE
$ bazel build //:x
INFO: Found 1 target...
Target //:x up-to-date:
bazel-bin/libx.jar
INFO: Elapsed time: 3.281s, Critical Path: 1.75s
$ touch WORKSPACE
$ bazel build //:x
INFO: Found 1 target...
Target //:x up-to-date:
bazel-bin/libx.jar
INFO: Elapsed time: 3.296s, Critical Path: 0.23s