This is an archive of the discontinued Mercurial Phabricator instance.

rust-status: collect traversed directories if required
ClosedPublic

Authored by Alphare on May 12 2020, 7:50 AM.

Details

Summary

Some commands (hg purge notably) register the traversedir callback on their
matcher to run said callback every time a directory is traversed.

This is the first of three patches, further broadening Rust support for status.

Unfortunately, there is no way around collecting a full Vec (or any other
owned datastructure, like a radix tree) and pushing it back up the Python layer
since keeping the Python callback in a closure would mean giving up
multithreading because of the GIL, which is obviously unacceptable.

Performance is still a lot better than the Python+C path.

Running hg clean/purge on Netbeans' repo (100k files):

     | No-op | 30% unknown
--------------------------
Rust | 1.0s  | 1.67s
C    | 2.0s  | 2.87s

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

Alphare created this revision.May 12 2020, 7:50 AM
This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.