This is an archive of the discontinued Mercurial Phabricator instance.

dirstate-tree: Borrow copy source paths from the "on disk" bytes
ClosedPublic

Authored by SimonSapin on May 3 2021, 6:26 AM.

Details

Summary

Use std::borrow::Cow to avoid some memory allocations and copying.

These particular allocations are not visible when profiling (as many files
in a typical repo don’t have a copy source). This change is "warm up"
for doing the same with paths of files themselves, which is more involved
since those paths are used as HashMap keys. This gets of the way the
addition of a lifetime parameter to several types.

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.