[Commented On] D11721: rhg: more efficient `HgPath::join`
aalekseyev (Arseniy Alekseyev)
phabricator at mercurial-scm.org
Wed Oct 27 10:31:35 UTC 2021
aalekseyev added a comment.
Whoops, this last version didn't even compile (I compiled the wrong workspace when I made the tweak). I pushed a version that compiles now.
I saw the performance difference on .hgignore parsing (saw a 1ms improvement or so), but I don't think there's a command that makes that operation in isolation.
I'm looking at adding `rhg debugignore`.
I just realized that the extra copying that I removed was potentially useful. After a call to `extend` the buffer has spare capacity, so the call to `HgPathBuf::from_bytes` was trimming the unnecessary bytes. Removal this trimming saves time, but wastes some memory.
I'm assuming this is a fine tradeoff if the standard library is taking it, but I imagine we could get the best of both worlds if we pre-allocated a vector of the right capacity from the start.
REPOSITORY
rHG Mercurial
BRANCH
stable
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D11721/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D11721
To: aalekseyev, #hg-reviewers, Alphare
Cc: Alphare, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20211027/eb01da0e/attachment-0002.html>
More information about the Mercurial-patches
mailing list