Patchwork D7121: copies: get copies information directly from _copies

login
register
mail settings
Submitter phabricator
Date Oct. 16, 2019, 4:54 p.m.
Message ID <differential-rev-PHID-DREV-dxiv24fjdzijwza6asgl-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/42406/
State Superseded
Headers show

Comments

phabricator - Oct. 16, 2019, 4:54 p.m.
marmoute created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Performance measurement does not show any significant performance movement. This
  is not surprising since p1copies() code is `self._copies[0]`.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7121

AFFECTED FILES
  mercurial/copies.py

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-devel
phabricator - Oct. 16, 2019, 5:12 p.m.
This revision is now accepted and ready to land.
martinvonz added a comment.
martinvonz accepted this revision.


  > Performance measurement does not show any significant performance movement. This
  > is not surprising since p1copies() code is self._copies[0].
  
  My testing agrees with that. However, making the same change (well, the reverse of it) on top of D7070 <https://phab.mercurial-scm.org/D7070> makes very significant difference. I have no idea why.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7121/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7121

To: marmoute, #hg-reviewers, martinvonz
Cc: martinvonz, mercurial-devel
phabricator - Oct. 16, 2019, 5:15 p.m.
martinvonz added a comment.


  In D7121#104543 <https://phab.mercurial-scm.org/D7121#104543>, @martinvonz wrote:
  
  >> Performance measurement does not show any significant performance movement. This
  >> is not surprising since p1copies() code is self._copies[0].
  >
  > My testing agrees with that. However, making the same change (well, the reverse of it) on top of D7070 <https://phab.mercurial-scm.org/D7070> makes very significant difference. I have no idea why.
  
  Actually, I may have spoken too soon. `hg perfpathcopies FIREFOX_BETA_59_END FIREFOX_BETA_60_BASE --config perf.run-limits='10.0-10'` yields:
  
    before:
    ! wall 4.595685 comb 4.600000 user 4.530000 sys 0.070000 (best of 10)
    after:
    ! wall 4.485065 comb 4.490000 user 4.440000 sys 0.050000 (best of 10)
  
  So there seems to be a measurable difference. Could just the function call overhead be that whole difference? Anyway, it doesn't seem worth spending time trying to figure out.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7121/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7121

To: marmoute, #hg-reviewers, martinvonz
Cc: martinvonz, mercurial-devel
phabricator - Oct. 16, 2019, 9:57 p.m.
marmoute added a comment.


  In D7121#104546 <https://phab.mercurial-scm.org/D7121#104546>, @martinvonz wrote:
  
  > In D7121#104543 <https://phab.mercurial-scm.org/D7121#104543>, @martinvonz wrote:
  >
  >>> Performance measurement does not show any significant performance movement. This
  >>> is not surprising since p1copies() code is self._copies[0].
  >>
  >> My testing agrees with that. However, making the same change (well, the reverse of it) on top of D7070 <https://phab.mercurial-scm.org/D7070> makes very significant difference. I have no idea why.
  >
  > Actually, I may have spoken too soon. `hg perfpathcopies FIREFOX_BETA_59_END FIREFOX_BETA_60_BASE --config perf.run-limits='10.0-10'` yields:
  >
  >   before:
  >   ! wall 4.595685 comb 4.600000 user 4.530000 sys 0.070000 (best of 10)
  >   after:
  >   ! wall 4.485065 comb 4.490000 user 4.440000 sys 0.050000 (best of 10)
  >
  > So there seems to be a measurable difference. Could just the function call overhead be that whole difference? Anyway, it doesn't seem worth spending time trying to figure out.
  
  Function call can have a large overhead, how many revision are we talking about here ?

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7121/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7121

To: marmoute, #hg-reviewers, martinvonz
Cc: martinvonz, mercurial-devel
phabricator - Oct. 16, 2019, 9:59 p.m.
martinvonz added a comment.


  In D7121#104671 <https://phab.mercurial-scm.org/D7121#104671>, @marmoute wrote:
  
  > In D7121#104546 <https://phab.mercurial-scm.org/D7121#104546>, @martinvonz wrote:
  >
  >> In D7121#104543 <https://phab.mercurial-scm.org/D7121#104543>, @martinvonz wrote:
  >>
  >>>> Performance measurement does not show any significant performance movement. This
  >>>> is not surprising since p1copies() code is self._copies[0].
  >>>
  >>> My testing agrees with that. However, making the same change (well, the reverse of it) on top of D7070 <https://phab.mercurial-scm.org/D7070> makes very significant difference. I have no idea why.
  >>
  >> Actually, I may have spoken too soon. `hg perfpathcopies FIREFOX_BETA_59_END FIREFOX_BETA_60_BASE --config perf.run-limits='10.0-10'` yields:
  >>
  >>   before:
  >>   ! wall 4.595685 comb 4.600000 user 4.530000 sys 0.070000 (best of 10)
  >>   after:
  >>   ! wall 4.485065 comb 4.490000 user 4.440000 sys 0.050000 (best of 10)
  >>
  >> So there seems to be a measurable difference. Could just the function call overhead be that whole difference? Anyway, it doesn't seem worth spending time trying to figure out.
  >
  > Function call can have a large overhead, how many revision are we talking about here ?
  
  5627

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7121/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7121

To: marmoute, #hg-reviewers, martinvonz
Cc: martinvonz, mercurial-devel
phabricator - Oct. 16, 2019, 10:26 p.m.
marmoute added a comment.


  In D7121#104672 <https://phab.mercurial-scm.org/D7121#104672>, @martinvonz wrote:
  
  > In D7121#104671 <https://phab.mercurial-scm.org/D7121#104671>, @marmoute wrote:
  >
  >> In D7121#104546 <https://phab.mercurial-scm.org/D7121#104546>, @martinvonz wrote:
  >>
  >>>> […]
  >>>
  >>> So there seems to be a measurable difference. Could just the function call overhead be that whole difference? Anyway, it doesn't seem worth spending time trying to figure out.
  >>
  >> Function call can have a large overhead, how many revision are we talking about here ?
  >
  > 5627
  
  That is not much to be honest. How do you measure this?

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7121/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7121

To: marmoute, #hg-reviewers, martinvonz
Cc: martinvonz, mercurial-devel
phabricator - Oct. 16, 2019, 10:31 p.m.
martinvonz added a comment.


  In D7121#104673 <https://phab.mercurial-scm.org/D7121#104673>, @marmoute wrote:
  
  > In D7121#104672 <https://phab.mercurial-scm.org/D7121#104672>, @martinvonz wrote:
  >
  >> In D7121#104671 <https://phab.mercurial-scm.org/D7121#104671>, @marmoute wrote:
  >>
  >>> In D7121#104546 <https://phab.mercurial-scm.org/D7121#104546>, @martinvonz wrote:
  >>>
  >>>>> […]
  >>>>
  >>>> So there seems to be a measurable difference. Could just the function call overhead be that whole difference? Anyway, it doesn't seem worth spending time trying to figure out.
  >>>
  >>> Function call can have a large overhead, how many revision are we talking about here ?
  >>
  >> 5627
  >
  > That is not much to be honest. How do you measure this?
  
  By running exactly the command I shared earlier :P This is a version of mozilla-unified I've created by running `hg convert --config experimental.copies.write-to=changeset-only`.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7121/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7121

To: marmoute, #hg-reviewers, martinvonz
Cc: martinvonz, mercurial-devel
phabricator - Oct. 16, 2019, 10:39 p.m.
marmoute added a comment.


  In D7121#104674 <https://phab.mercurial-scm.org/D7121#104674>, @martinvonz wrote:
  
  > In D7121#104673 <https://phab.mercurial-scm.org/D7121#104673>, @marmoute wrote:
  >
  >> In D7121#104672 <https://phab.mercurial-scm.org/D7121#104672>, @martinvonz wrote:
  >>
  >>> In D7121#104671 <https://phab.mercurial-scm.org/D7121#104671>, @marmoute wrote:
  >>>
  >>>> In D7121#104546 <https://phab.mercurial-scm.org/D7121#104546>, @martinvonz wrote:
  >>>>
  >>>>>> […]
  >>>>>
  >>>>> So there seems to be a measurable difference. Could just the function call overhead be that whole difference? Anyway, it doesn't seem worth spending time trying to figure out.
  >>>>
  >>>> Function call can have a large overhead, how many revision are we talking about here ?
  >>>
  >>> 5627
  >>
  >> That is not much to be honest. How do you measure this?
  >
  > By running exactly the command I shared earlier :P This is a version of mozilla-unified I've created by running `hg convert --config experimental.copies.write-to=changeset-only`.
  
  I meant the number of changeset :-)

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7121/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7121

To: marmoute, #hg-reviewers, martinvonz
Cc: martinvonz, mercurial-devel
phabricator - Oct. 16, 2019, 10:41 p.m.
marmoute added a comment.


  In D7121#104675 <https://phab.mercurial-scm.org/D7121#104675>, @marmoute wrote:
  
  > In D7121#104674 <https://phab.mercurial-scm.org/D7121#104674>, @martinvonz wrote:
  >
  >> In D7121#104673 <https://phab.mercurial-scm.org/D7121#104673>, @marmoute wrote:
  >>
  >>> In D7121#104672 <https://phab.mercurial-scm.org/D7121#104672>, @martinvonz wrote:
  >>>
  >>>> In D7121#104671 <https://phab.mercurial-scm.org/D7121#104671>, @marmoute wrote:
  >>>>
  >>>>> In D7121#104546 <https://phab.mercurial-scm.org/D7121#104546>, @martinvonz wrote:
  >>>>>
  >>>>>>> […]
  >>>>>>
  >>>>>> So there seems to be a measurable difference. Could just the function call overhead be that whole difference? Anyway, it doesn't seem worth spending time trying to figure out.
  >>>>>
  >>>>> Function call can have a large overhead, how many revision are we talking about here ?
  >>>>
  >>>> 5627
  >>>
  >>> That is not much to be honest. How do you measure this?
  >>
  >> By running exactly the command I shared earlier :P This is a version of mozilla-unified I've created by running `hg convert --config experimental.copies.write-to=changeset-only`.
  >
  > I meant the number of changeset :-)
  
  I did a fresh clone and fished this myself. I indeed see the same number
  
    hg log -T '.\n' -r FIREFOX_BETA_60_BASE%FIREFOX_BETA_59_END | wc -l

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7121/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7121

To: marmoute, #hg-reviewers, martinvonz
Cc: martinvonz, mercurial-devel

Patch

diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -207,13 +207,14 @@ 
             return copies
         for i, c in enumerate(children[r]):
             childctx = repo[c]
+            p1copies, p2copies = childctx._copies
             if r == childctx.p1().rev():
                 parent = 1
-                childcopies = childctx.p1copies()
+                childcopies = p1copies
             else:
                 assert r == childctx.p2().rev()
                 parent = 2
-                childcopies = childctx.p2copies()
+                childcopies = p2copies
             if not alwaysmatch:
                 childcopies = {
                     dst: src for dst, src in childcopies.items() if match(dst)