Page MenuHomePhabricator

When computing revision ownership, cache some intermediate results for performance
ClosedPublic

Authored by epriestley on Feb 27 2017, 4:05 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Mar 19, 6:08 PM
Unknown Object (File)
Tue, Mar 19, 6:08 PM
Unknown Object (File)
Jan 26 2024, 8:52 AM
Unknown Object (File)
Jan 21 2024, 5:12 AM
Unknown Object (File)
Jan 18 2024, 8:34 AM
Unknown Object (File)
Dec 25 2023, 7:57 PM
Unknown Object (File)
Dec 21 2023, 9:33 AM
Unknown Object (File)
Nov 30 2023, 3:38 AM
Subscribers
None

Details

Summary

Ref T12319. With large datasets, the computation of which packages own paths in a revision is needlessly slow.

Improve performance through caching:

  • Cache which paths belong to each repository.
  • Cache the split fragments of each path.
  • Cache the path fragment counts.
  • Micro-optimize accessing $this->path.
Test Plan
  • Used bin/lipsum to generate 4,000 packages with 150,000 paths.
  • Created a revision affecting 100 paths in phabricator/ (these paths mostly overlap with bin/lipsum path rules, since Lipsum uses Phabricator-like rules to generate paths).
  • Before optimizations, this revision spent about 5.5 seconds computing paths.
  • After optimizations, it spends about 275ms.

Screen Shot 2017-02-27 at 8.01.39 AM.png (1×2 px, 375 KB)

Diff Detail

Repository
rP Phabricator
Branch
lipsum6
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 15794
Build 20886: Run Core Tests
Build 20885: arc lint + arc unit