D7122: copies: avoid instancing more changectx to access parent revisions
marmoute updated this revision to Diff 17272. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7122?vs=17248&id=17272 CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7122/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7122 AFFECTED FILES mercurial/copies.py CHANGE DETAILS diff --git a/mercurial/copies.py b/mercurial/copies.py --- a/mercurial/copies.py +++ b/mercurial/copies.py @@ -207,12 +207,13 @@ return copies for i, c in enumerate(children[r]): childctx = repo[c] +p1, p2 = cl.parentrevs(c) p1copies, p2copies = childctx._copies -if r == childctx.p1().rev(): +if r == p1: parent = 1 childcopies = p1copies else: -assert r == childctx.p2().rev() +assert r == p2 parent = 2 childcopies = p2copies if not alwaysmatch: To: marmoute, #hg-reviewers, martinvonz Cc: martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D7122: copies: avoid instancing more changectx to access parent revisions
Closed by commit rHG6b43c7be2d15: copies: avoid instancing more changectx to access parent revisions (authored by marmoute). This revision was automatically updated to reflect the committed changes. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7122?vs=17241&id=17248 CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7122/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7122 AFFECTED FILES mercurial/copies.py CHANGE DETAILS diff --git a/mercurial/copies.py b/mercurial/copies.py --- a/mercurial/copies.py +++ b/mercurial/copies.py @@ -207,12 +207,13 @@ return copies for i, c in enumerate(children[r]): childctx = repo[c] +p1, p2 = cl.parentrevs(c) p1copies, p2copies = childctx._copies -if r == childctx.p1().rev(): +if r == p1: parent = 1 childcopies = p1copies else: -assert r == childctx.p2().rev() +assert r == p2 parent = 2 childcopies = p2copies if not alwaysmatch: To: marmoute, #hg-reviewers, martinvonz Cc: martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D7122: copies: avoid instancing more changectx to access parent revisions
This revision is now accepted and ready to land. martinvonz added a comment. martinvonz accepted this revision. In my copies-in-changesets version of mozilla-unified, this makes a very significant difference: before: ! wall 4.485065 comb 4.49 user 4.44 sys 0.05 (best of 10) after: ! wall 3.695755 comb 3.69 user 3.66 sys 0.03 (best of 10) REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7122/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7122 To: marmoute, #hg-reviewers, martinvonz Cc: martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D7122: copies: avoid instancing more changectx to access parent revisions
marmoute created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY We just need to know the revision numbers of the parents, creating full context is needlessly expensive. This provide a small, but noticeable performance boost. revision: large amount; added files: large amount; rename small amount; c3b14617fbd7 9ba6ab77fd29 before: ! wall 2.885636 comb 2.90 user 2.87 sys 0.03 (median of 10) after: ! wall 2.702270 comb 2.71 user 2.69 sys 0.02 (median of 10) revision: large amount; added files: small amount; rename small amount; c3b14617fbd7 f650a9b140d2 before: ! wall 4.298271 comb 4.29 user 4.24 sys 0.05 (median of 10) after: ! wall 3.976610 comb 3.97 user 3.92 sys 0.05 (median of 10) revision: large amount; added files: large amount; rename large amount; 08ea3258278e d9fa043f30c0 before: ! wall 0.773397 comb 0.77 user 0.77 sys 0.00 (median of 11) after: ! wall 0.701634 comb 0.70 user 0.70 sys 0.00 (median of 13) revision: small amount; added files: large amount; rename large amount; df6f7a526b60 a83dc6a2d56f before: ! wall 0.013585 comb 0.01 user 0.01 sys 0.00 (median of 217) after: ! wall 0.013550 comb 0.01 user 0.01 sys 0.00 (median of 218) revision: small amount; added files: large amount; rename small amount; 4aa4e1f8e19a 169138063d63 before: ! wall 0.003202 comb 0.00 user 0.00 sys 0.00 (median of 929) after: ! wall 0.002993 comb 0.01 user 0.01 sys 0.00 (median of 992) revision: small amount; added files: small amount; rename small amount; 4bc173b045a6 964879152e2e before: ! wall 0.77 comb 0.00 user 0.00 sys 0.00 (median of 12060) after: ! wall 0.72 comb 0.00 user 0.00 sys 0.00 (median of 12804) revision: medium amount; added files: large amount; rename medium amount; c95f1ced15f2 2c68e87c3efe before: ! wall 0.510614 comb 0.50 user 0.50 sys 0.00 (median of 18) after: ! wall 0.473681 comb 0.47 user 0.47 sys 0.00 (median of 20) revision: medium amount; added files: medium amount; rename small amount; d343da0c55a8 d7746d32bf9d before: ! wall 0.126552 comb 0.13 user 0.13 sys 0.00 (median of 77) after: ! wall 0.115240 comb 0.11 user 0.11 sys 0.00 (median of 85) REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D7122 AFFECTED FILES mercurial/copies.py CHANGE DETAILS diff --git a/mercurial/copies.py b/mercurial/copies.py --- a/mercurial/copies.py +++ b/mercurial/copies.py @@ -207,12 +207,13 @@ return copies for i, c in enumerate(children[r]): childctx = repo[c] +p1, p2 = cl.parentrevs(c) p1copies, p2copies = childctx._copies -if r == childctx.p1().rev(): +if r == p1: parent = 1 childcopies = p1copies else: -assert r == childctx.p2().rev() +assert r == p2 parent = 2 childcopies = p2copies if not alwaysmatch: To: marmoute, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel