branches: add -r option to show branch name(s) of a given rev (
issue5948)
Differential Revision: https://phab.mercurial-scm.org/D5486
progress: avoid ui.configbool() lookup when progress bar is active
Profiling revealed that the ui.configbool('progress', 'debug') during
progress bar updates was consuming a significant amount of overhead.
This commit adds an attribute on progress bar instances that caches
this config option.
The impact on `hg perfprogress` with default options is significant:
before: ! wall 4.641942 comb 4.580000 user 4.210000 sys 0.370000 (best of 3)
after: ! wall 1.948626 comb 1.950000 user 1.950000 sys 0.000000 (best of 5)
After this change, profiling reveals that progress.progbar.progress()
is now consuming ~73% of time.
This change does not improve the execution time if the progress bar
is disabled. We may want a more comprehensive solution for that case,
as the progress bar won't be enabled in a number of scenarios (e.g.
servers and processes not attached to an interactive TTY).
I also think that overhead of ~2.0s for 1M updates is a bit high.
I suspect further refactoring of the progress bar can significantly
reduce overhead. I don't have plans to do this, however.
Differential Revision: https://phab.mercurial-scm.org/D5408
largefiles: port wrapped functions to exthelper
Things get interesting in the commit. I hadn't seen
issue6033 on Windows, and
yet it is now reproducible 100% of the time on Windows 10 with this commit. I
didn't test Linux. (For comparison, after seeing this issue, I tested on the
parent with --loop, and it failed 5 times out of over 1300 tests.)
The strange thing is that largefiles has nothing to do with that test (it's not
even mentioned there). It isn't autoloading run amuck- it occurs even if
largefiles is explicitly disabled, and also if the entry in afterhgrcload() is
commented out. It's also not the import of lfutil- I disabled that by copying
the function into lfs and removing the import, and the problem still occurs.
Experimenting further, it seems that the problem is isolated to 3 entries:
exchange.pushoperation, hg.clone, and cmdutil.revert. If those decorators are
all commented out, the test passes when run in a loop for awhile. (Obviously,
some largefiles tests will fail.) But if any one is commented back in, the test
fails immediately.
I left one method related to wrapping the wire protocol, because it seemed more
natural with the TODO. Also, exthelper doesn't support wrapping functions from
another extension, only commands in another extension. I didn't try to figure
out why rebase is both command wrapped and function wrapped.