When the internal and archived phase was added, allphase became a large,
sparsely populated list. This dramatically increased the number of
lookup operations for public relations in phasecache.phase. As a first
step, define allphases and related lists explicitly to contain only the
actual phases. Make phasenames a dictionary and create corresponding
dictionaries for mapping phase names back to numbers. Adjust various
list to be sparse as well with the exception of phaseroots and phasesets
members of phasecache. Keep those as a separate step as it involves
changes to the C module.
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHGb1e51ef4e536: phases: sparsify phase lists
Diff Detail
- Repository
- rHG Mercurial
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
mercurial/phases.py | ||
---|---|---|
152 | These all makes me think that we need a class here. What do you think? |
mercurial/phases.py | ||
---|---|---|
152 | I'm not sure if turning the various lists into predicates or so would actually improve anything. I did change this from the original form to make it easier to reason about them, but otherwise this part is a NFC. Anything more would be much more intrusive and possibly also affect 3rd party extensions like evolve with non-trivial follow-up changes. It doesn't seem to be worth the effort. |
These all makes me think that we need a class here. What do you think?