This is an archive of the discontinued Mercurial Phabricator instance.

clindex: use childmap to calculate phases
AbandonedPublic

Authored by quark on Nov 27 2017, 1:30 PM.
Tags
None
Subscribers
None

Details

Reviewers
None
Group Reviewers
Restricted Project
Summary

Calculating phases is O(len(changelog)) since it scans revisions starting
with min(draft()) (unfiltered). Use the childmap so it is actually
O(len(not public())).

This saves 100+ms for a fbsource repo created in late 2015.

Besides, the old phases code build a O(len(changelog)) Python list for
rev -> phase queries. This patch does not build such list and saves
O(len(changelog)) memory.

Test Plan

With verify mode on, run core hg tests and make sure there is no
inconsistent cases with the original phases implementation.

Diff Detail

Repository
rFBHGX Facebook Mercurial Extensions
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

quark created this revision.Nov 27 2017, 1:30 PM
Herald added a reviewer: Restricted Project. · View Herald TranscriptNov 27 2017, 1:30 PM
quark updated this revision to Diff 4458.Dec 14 2017, 9:21 PM
quark abandoned this revision.Dec 7 2019, 2:13 AM

Took another approach.