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
F18084797: D17424.id41893.diff
Tue, Aug 5, 5:30 PM
F18081997: D17424.id41899.diff
Tue, Aug 5, 3:27 AM
F18080003: D17424.id.diff
Mon, Aug 4, 9:32 PM
F18051553: D17424.diff
Sun, Aug 3, 11:40 PM
F17949418: D17424.id41893.diff
Thu, Jul 31, 11:23 PM
F17938717: D17424.diff
Jul 31 2025, 2:33 AM
F17668682: D17424.diff
Jul 12 2025, 11:20 PM
Unknown Object (File)
Jul 3 2025, 10:23 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
Lint
Lint Not Applicable
Unit
Tests Not Applicable