Page MenuHomePhabricator

Improve performance of repository discovery in repositories with >65K refs
ClosedPublic

Authored by epriestley on Jan 26 2021, 7:10 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Dec 8, 1:28 PM
Unknown Object (File)
Tue, Dec 3, 11:08 AM
Unknown Object (File)
Tue, Nov 26, 12:30 PM
Unknown Object (File)
Nov 11 2024, 2:57 AM
Unknown Object (File)
Nov 10 2024, 7:34 AM
Unknown Object (File)
Nov 5 2024, 1:53 PM
Unknown Object (File)
Oct 31 2024, 6:26 AM
Unknown Object (File)
Oct 18 2024, 1:45 PM
Subscribers
None

Details

Summary

Ref T13593. The commit cache in this Engine has a maximum fixed size (currently 65,535 entries).

If we execute discovery in a repository with more refs than this (e.g., 180K), we get fast lookups for the first 65,535 refs and slow lookups for the remaining refs.

Instead, divide the refs into chunks no larger than the cache size, and perform an explicit cache fill before each chunk is processed.

Test Plan
  • Created a repository with 1K refs. Set cache size to 256. Ran discovery.
    • Before patch: saw one large cache fill and then ~750 single-gets.
    • After patch: saw four large cache fills.
  • Compared bin/repository discover ... --verbose output before and after patch for overall effect; saw no differences.

Diff Detail

Repository
rP Phabricator
Branch
discovery1
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 25037
Build 34545: Run Core Tests
Build 34544: arc lint + arc unit