D7483: changectx: add a "maybe filtered" filtered attribute
indygreg (Gregory Szorc)
phabricator at mercurial-scm.org
Fri Nov 22 23:04:56 EST 2019
indygreg added inline comments.
INLINE COMMENTS
> context.py:503
> + repo = self._repo.unfiltered()
> + return repo.changelog.changelogrevision(self.rev())
>
Before I accept more of this series, I'd like others to think about the potential alternative solution of passing in or storing a reference to the changelog on `basectx`/`changectx`. The reason is that a lot of methods are calling `repo.changelog` and this can be expensive. I suspect we'd get a handful of random performance wins if we cached the changelog instance on each `basectx`. We also wouldn't need to litter the code with a bunch of conditional `repo.unfiltered()` calls since we'd already have an appropriate changelog instance stored in the instance.
Thoughts?
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D7483/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D7483
To: marmoute, #hg-reviewers
Cc: indygreg, mercurial-devel
More information about the Mercurial-devel
mailing list