Skip to content
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

Cleanup importpath/importmap handling in go_context #4052

Merged
merged 1 commit into from
Aug 17, 2024

Conversation

dzbarsky
Copy link
Contributor

What type of PR is this?
Starlark cleanup

What does this PR do? Why is it needed?
This looks like a 50-100ms speedup from avoiding the array allocation in infer_importpaths and reduced getattr calls. Is getattr slower than direct property access? (If not, we can avoid passing in the values from go_library)

Which issues(s) does this PR fix?

Fixes #

Other notes for review

@dzbarsky dzbarsky force-pushed the zbarsky/importpath branch from 6c7a483 to b29094d Compare August 17, 2024 00:07
Copy link
Member

@fmeum fmeum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also a win in explicitness.

Property access and in particular operators are faster than method calls as they don't involve the fully general construction of argument arrays.

@fmeum fmeum merged commit 6749a38 into bazel-contrib:master Aug 17, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants