Created
May 9, 2018 21:58
-
-
Save benjaminp/23206c874edd4b2a61b9d31a59ca79d9 to your computer and use it in GitHub Desktop.
a Bazel memory regression
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The regression can be demonstrated with the workspace in this Gist and Bazel 0.11.1 and Bazel 0.13: | |
$ ../bazel-0.11.1/output/bazel build --nobuild //:my-target | |
$ ../bazel-0.11.1/output/bazel info used-heap-size-after-gc | |
37MB | |
$ ../bazel-0.13.0/output/bazel build --nobuild //:my-target | |
$ ../bazel-0.13.0/output/bazel info used-heap-size-after-gc | |
42MB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
load(':lots_of_runfiles.bzl', 'lots_of_runfiles') | |
lots_of_runfiles(name = 'my-target') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _lots_of_runfiles(ctx): | |
empty = ctx.actions.declare_file('dummy') | |
ctx.actions.write(content='', output=empty) | |
template = 'ponderously/long/filesystem/path/which/becomes/one/symlink/in/the/runfiles/tree/%s' | |
symlinks = { | |
template % (i,): empty | |
for i in range(100000) | |
} | |
return [DefaultInfo(runfiles=ctx.runfiles(symlinks=symlinks))] | |
lots_of_runfiles = rule(implementation=_lots_of_runfiles) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This page intentionally left blank |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment