Bug 255737 - [git-webkit] Avoid listing all branches for old commits
Summary: [git-webkit] Avoid listing all branches for old commits
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jonathan Bedard
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-04-20 11:22 PDT by Jonathan Bedard
Modified: 2023-04-21 07:42 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Bedard 2023-04-20 11:22:55 PDT
git-webkit will attempt to list _all_ branches for really old commits. That is extremely inefficient, especially for a project like WebKit which has thousands of branches. We should short-circuit listing all branches by first checking if a commit is explicitly on `main`.
Comment 1 Radar WebKit Bug Importer 2023-04-20 11:23:20 PDT
<rdar://problem/108328653>
Comment 2 Jonathan Bedard 2023-04-20 11:46:49 PDT
Specifically, it seems to be this bit that's the biggest offender:

if branch != default_branch:
    branch = self.prioritize_branches(self.branches_for(hash), self.branch)

Which will always list all branches for a given hash just to determine that hash is, in fact, on `main`.
Comment 3 Jonathan Bedard 2023-04-20 11:54:04 PDT
Pull request: https://github.com/WebKit/WebKit/pull/12984
Comment 4 EWS 2023-04-20 12:49:11 PDT
Committed 263190@main (610c7d596fb7): <https://commits.webkit.org/263190@main>

Reviewed commits have been landed. Closing PR #12984 and removing active labels.
Comment 5 EWS 2023-04-21 07:42:30 PDT
Committed 259548.676@safari-7615-branch (39b0087a0443): <https://commits.webkit.org/259548.676@safari-7615-branch>

Reviewed commits have been landed. Closing PR #556 and removing active labels.