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

Remove branchMap in prepareNormalBuild #838

Merged
merged 1 commit into from
Sep 30, 2024
Merged

Conversation

jtibshirani
Copy link
Member

@jtibshirani jtibshirani commented Sep 27, 2024

This PR refactors the "build preparation" code to remove branchMap, in favor of storing everything in a single map. The main motivation is just to make the code clearer.

Specific changes:

  • Store branches in the same map as blob locations, remove branchMap
  • Introduce new struct BlobIndexInfo to hold the old location information, plus branches
  • Rename BlobLocation -> BlobRepo

To check there's no regression, I aadded a new benchmark BenchmarkPrepareNormalBuild. It shows small decrease in allocations:

Baseline vs. PR

BenchmarkPrepareNormalBuild-10    	       1	3649848792 ns/op	1632152832 B/op	 4260303 allocs/op
BenchmarkPrepareNormalBuild-10    	       1	3888314833 ns/op	1561963752 B/op	 4249175 allocs/op

@cla-bot cla-bot bot added the cla-signed label Sep 27, 2024
@jtibshirani jtibshirani requested a review from a team September 28, 2024 00:01
@jtibshirani jtibshirani merged commit 282a251 into main Sep 30, 2024
9 checks passed
@jtibshirani jtibshirani deleted the jtibs/prepare-build branch September 30, 2024 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants