Page MenuHomePhabricator

hg-core: make parse_dirstate return references rather than update hashmaps
ClosedPublic

Authored by acezar on Aug 3 2020, 10:25 AM.

Details

Summary

Returing a vec is faster than updating a hashmap when the hashmap is not needed
like in hg files which just list tracked files.

Returning references avoid copying data when not needed improving performence
for large repositories.

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

acezar created this revision.Aug 3 2020, 10:25 AM
Alphare accepted this revision.Aug 3 2020, 10:59 AM
Alphare added a subscriber: Alphare.
Alphare added inline comments.
rust/hg-cpython/src/parsers.rs
34

These should be a collect() instead of default + extend.

acezar updated this revision to Diff 22245.Aug 4 2020, 4:57 AM
acezar updated this revision to Diff 22267.Aug 5 2020, 4:58 AM
indygreg accepted this revision.Aug 8 2020, 3:43 PM
This revision is now accepted and ready to land.Aug 8 2020, 3:43 PM