-
Notifications
You must be signed in to change notification settings - Fork 524
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
perf: avoid unnecessary nested depset() #1435
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes I've seen Bazel team sending such changes, they have some new static checking for this anti-pattern? Thanks!
internal/node/node.bzl
Outdated
|
||
return [ | ||
DefaultInfo( | ||
executable = executable, | ||
runfiles = ctx.runfiles( | ||
transitive_files = runfiles, | ||
transitive_files = depset(runfiles_depsets), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the fact that you don't use transitive = runfiles_depsets
makes me think the variable is misnamed, and runfiles_depsets is actually just runfiles list
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I guess it is just plain files, previously those plain files were converted into transitive depset
s though. I think this change is ok though, but the var should be renamed...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to just runfiles
7c1c888
to
c685e73
Compare
sources_sets = [] | ||
# Also avoid deap transitive depset()s by creating single array of | ||
# transitive depset()s | ||
sources_depsets = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a rename after rebasing. Revert?
Updated. I think the buildkite failure is random? |
Or maybe it isn't random? I don't see how that could be related though... |
@alexeagle the build failure seems to be the same thing as PRs such as #1445 - so I guess it is random and unrelated to this change? |
Yes that test is terribly flaky right now, in that it sometimes but rarely passes. We need to jump on that this week. |
As described in the bazel docs unnecessarily nesting
depset
s is a performance anti-pattern.I think all these cases are pretty basic changes?