This is an archive of the discontinued Mercurial Phabricator instance.

histedit: cache description line
ClosedPublic

Authored by martinvonz on Sep 11 2020, 12:48 PM.

Details

Summary

Navigating the curses-based histedit interface can be pretty slow
because it redraws everything whenever you make a change.

This patch simply replaces @property by @util.propertycache on the
histeditrule.desc() function so it's not re-calculated every time
the screen needs to be re-rendered. I timed it on an example of 30
simple commits, where I moved the top commit down 25 steps and then up
25 steps after. Before this patch, that (the whole hg histedit
invocation) took 11.6 s of CPU and after this patch it took 0.8 s).

Diff Detail

Repository
rHG Mercurial
Branch
default
Lint
No Linters Available
Unit
No Unit Test Coverage

Event Timeline

martinvonz created this revision.Sep 11 2020, 12:48 PM
marmoute accepted this revision.Sep 11 2020, 5:05 PM
marmoute added a subscriber: marmoute.

great

pulkit accepted this revision.Sep 14 2020, 3:08 AM
This revision is now accepted and ready to land.Sep 14 2020, 3:08 AM
This revision was automatically updated to reflect the committed changes.