This is an archive of the discontinued Mercurial Phabricator instance.

rhg: use persistent nodemap when available
ClosedPublic

Authored by SimonSapin on Dec 4 2020, 12:28 PM.

Details

Summary

… for node ID → revision number lookups, instead on linear scan in a revlog.

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

SimonSapin created this revision.Dec 4 2020, 12:28 PM
Alphare requested changes to this revision.Dec 7 2020, 5:43 AM
Alphare added a subscriber: Alphare.
Alphare added inline comments.
rust/hg-core/src/revlog/nodemap_docket.rs
21

I would add a comment explaining why it's ok for the docket to not exist, even if it's kind of obvious.

39

32 bit systems will have other issues before running into this one, I don't think it's worth it.

51

I think we probably want to be able to disable mmap even in Rust contexts, although that will be done in a followup, since we need to have access to the config (storage.revlog.nodemap.mmap at the time of writing).

54

I think the Python code has a bug, and that the idea is to silently ignore the missing file.

rust/hg-core/src/revlog/revlog.rs
47

Please add a docstring

116–117

I think this comment should be adjusted now that the optimization has come

tests/test-rhg.t
201

I'd add a small header line to say "test partial node prefix" or something similar.

This revision now requires changes to proceed.Dec 7 2020, 5:43 AM

Note to other reviewers, we're discussing moving at least some of the binary parsing in hg-core to a crate like zerocopy or bytemuck in the near future.

SimonSapin added inline comments.Dec 7 2020, 12:53 PM
rust/hg-core/src/revlog/nodemap_docket.rs
21

I’ve restructured this code a bit and added a doc-comment.

54

I’ve added a separate patch to fix that Python code.

Alphare accepted this revision.Dec 7 2020, 2:38 PM
pulkit accepted this revision.Dec 10 2020, 3:51 AM
This revision is now accepted and ready to land.Dec 10 2020, 3:51 AM
This revision was automatically updated to reflect the committed changes.