Skip to content

Instantly share code, notes, and snippets.

@bsilver8192
Created February 7, 2016 20:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bsilver8192/10527a862ce16bb7f79a to your computer and use it in GitHub Desktop.
Save bsilver8192/10527a862ce16bb7f79a to your computer and use it in GitHub Desktop.
test for speed of Bazel's sandboxing code
inputs = ['input_%s' % i for i in range(3000)]
genrules = ['genrule_%s' % i for i in range(100)]
genrule(
name = 'gen_inputs',
outs = inputs,
cmd = 'touch ' + ' '.join(['$(location %s)' % i for i in inputs]),
)
[genrule(
name = 'gen_%s' % name,
srcs = inputs,
outs = [name],
cmd = 'touch $@',
) for name in genrules]
genrule(
name = 'gen_main',
srcs = genrules,
outs = ['main'],
cmd = 'touch $@',
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment