This is an archive of the discontinued Mercurial Phabricator instance.

branchmap: make branchcache responsible for reading
ClosedPublic

Authored by mjpieters on Jan 21 2019, 1:08 PM.

Details

Summary

Encapsulate reading in a classmethod, to make it clear what kind of object is
being handled.

This is part of a stack of refactoring changes to help performance improvements
down the line.

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

mjpieters created this revision.Jan 21 2019, 1:08 PM
martinvonz added inline comments.
contrib/perf.py
2412–2418

As I was recently reminded by Yuya, the perf commands are supposed to be compatible with older versions of hg too, and this doesn't seem to be compatible with the branchmap.read() version.

mjpieters added a subscriber: yuja.Jan 26 2019, 8:17 AM
mjpieters added inline comments.
contrib/perf.py
2412–2418

Why is that? @yuja, can you elaborate?

This is version-controlled code that changes in lock-step with the branchmap module, adding backwards compatibility tests here would add a costly maintenance burden. If you have an older revision of the branchmap module, you also have an older revision of the perf code.

mjpieters updated this revision to Diff 13501.Jan 26 2019, 8:45 AM
martinvonz added inline comments.Jan 26 2019, 9:42 AM
contrib/perf.py
2412–2418

I'm pretty sure the idea is that you should be able to enable the latest perf extension and run different versions of hg (perhaps versions that you had already built) against it to compare performance.

yuja added a comment.Jan 26 2019, 9:52 PM

Why is that? @yuja, can you elaborate?
This is version-controlled code that changes in lock-step with the branchmap module, adding backwards compatibility tests here would add a costly maintenance burden. If you have an older revision of the branchmap module, you also have an older revision of the perf code.

I'm pretty sure the idea is that you should be able to enable the latest perf extension and run different versions of hg (perhaps versions that you had already built) against it to compare performance.

Something like that IIRC. A perf function itself can be improved in a way
that the resulting number isn't comparable with the one of older perf codes.

It's documented in the header. 4533f5b47949

mjpieters updated this revision to Diff 13542.Jan 28 2019, 12:47 PM
mjpieters marked an inline comment as done.Jan 28 2019, 12:48 PM
pulkit accepted this revision.Feb 5 2019, 11:28 AM
This revision was automatically updated to reflect the committed changes.