D7071: copies: use unchecked parentrevs function to access parent

2019-10-14 Thread martinvonz (Martin von Zweigbergk)
martinvonz added inline comments.

INLINE COMMENTS

> copies.py:293
>  
>  repo = a.repo()
>  children = {}

Why not just add `.unfiltered()` here? That should be even faster (3.16s -> 
2.90s compared to this patch for the case I tested).

REPOSITORY
  rHG Mercurial

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

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

To: marmoute, #hg-reviewers
Cc: martinvonz, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D7071: copies: use unchecked parentrevs function to access parent

2019-10-12 Thread marmoute (Pierre-Yves David)
marmoute created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Since we are traveling the graph down from one head, we know we will not
  encounter any filtered revisions.
  
  Using the "unchecked" version is significantly faster.
  
  revision: large amount; added files: large amount; rename small amount; 
c3b14617fbd7 9ba6ab77fd29
  filelog: ! wall 3.679613 comb 3.68 user 3.58 sys 0.10 (median of 
3)
  base:! wall 8.884369 comb 8.88 user 8.85 sys 0.03 (median of 
3)
  before:  ! wall 4.697917 comb 4.69 user 4.66 sys 0.03 (median of 
3)
  after:   ! wall 4.681985 comb 4.68 user 4.64 sys 0.04 (median of 
3)
  revision: large amount; added files: small amount; rename small amount; 
c3b14617fbd7 f650a9b140d2
  filelog: ! wall 0.003357 comb 0.01 user 0.01 sys 0.00 (median of 
781)
  base:! wall 12.398524 comb 12.40 user 12.33 sys 0.07 (median 
of 3)
  before:  ! wall 6.750832 comb 6.75 user 6.64 sys 0.11 (median of 
3)
  after:   ! wall 6.459592 comb 6.47 user 6.39 sys 0.08 (median of 
3)
  revision: large amount; added files: large amount; rename large amount; 
08ea3258278e d9fa043f30c0
  filelog: ! wall 2.754687 comb 2.76 user 2.65 sys 0.11 (median of 
4)
  base:! wall 1.423166 comb 1.42 user 1.40 sys 0.02 (median of 
8)
  before:  ! wall 1.045916 comb 1.05 user 1.04 sys 0.01 (median of 
10)
  after:   ! wall 0.961048 comb 0.96 user 0.94 sys 0.02 (median of 
11)
  revision: small amount; added files: large amount; rename large amount; 
df6f7a526b60 a83dc6a2d56f
  filelog: ! wall 1.552293 comb 1.55 user 1.51 sys 0.04 (median of 6
  base:! wall 0.022662 comb 0.02 user 0.02 sys 0.00 (median of 
128)
  before:  ! wall 0.021577 comb 0.02 user 0.02 sys 0.00 (median of 
138)
  after:   ! wall 0.021649 comb 0.02 user 0.02 sys 0.00 (median of 
135)
  revision: small amount; added files: large amount; rename small amount; 
4aa4e1f8e19a 169138063d63
  filelog: ! wall 1.500983 comb 1.50 user 1.42 sys 0.08 (median of 
7)
  base:! wall 0.006956 comb 0.01 user 0.01 sys 0.00 (median of 
392)
  before:  ! wall 0.004329 comb 0.00 user 0.00 sys 0.00 (median of 
682)
  after:   ! wall 0.004022 comb 0.00 user 0.00 sys 0.00 (median of 
735)
  revision: small amount; added files: small amount; rename small amount; 
4bc173b045a6 964879152e2e
  filelog: ! wall 0.011745 comb 0.02 user 0.02 sys 0.00 (median of 
250)
  base:! wall 0.000156 comb 0.00 user 0.00 sys 0.00 (median of 
17180)
  before:  ! wall 0.000105 comb 0.00 user 0.00 sys 0.00 (median of 
25689)
  after:   ! wall 0.000118 comb 0.00 user 0.00 sys 0.00 (median of 
19170)
  revision: medium amount; added files: large amount; rename medium amount; 
c95f1ced15f2 2c68e87c3efe
  filelog: ! wall 3.228230 comb 3.23 user 3.11 sys 0.12 (median of 
4)
  base:! wall 0.997640 comb 1.00 user 0.98 sys 0.02 (median of 
10)
  before:  ! wall 0.706594 comb 0.71 user 0.71 sys 0.00 (median of 
15)
  after:   ! wall 0.679500 comb 0.68 user 0.68 sys 0.00 (median of 
15)
  revision: medium amount; added files: medium amount; rename small amount; 
d343da0c55a8 d7746d32bf9d
  filelog: ! wall 1.052501 comb 1.06 user 1.04 sys 0.02 (median of 
10
  base:! wall 0.214519 comb 0.22 user 0.22 sys 0.00 (median of 
45)
  before:  ! wall 0.163736 comb 0.16 user 0.16 sys 0.00 (median of 
60)
  after:   ! wall 0.149675 comb 0.15 user 0.15 sys 0.00 (median of 
66)

REPOSITORY
  rHG Mercurial

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

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
@@ -274,9 +274,10 @@
 * removed: a list of removed files
 """
 cl = repo.changelog
+parents = cl._uncheckedparentrevs
 
 def revinfo(rev):
-p1, p2 = cl.parentrevs(rev)
+p1, p2 = parents(rev)
 ctx = repo[rev]
 p1copies, p2copies = ctx._copies
 removed = ctx.filesremoved()
@@ -292,11 +293,12 @@
 repo = a.repo()
 children = {}
 revinfo = _revinfogetter(repo)
+parents = repo.changelog._uncheckedparentrevs
 
 cl = repo.changelog
 missingrevs = cl.findmissingrevs(common=[a.rev()], heads=[b.rev()])
 for r in missingrevs:
-for p in cl.parentrevs(r):
+for p in parents(r):
 if p == node.nullrev:
 continue
 if p not in children:



To: marmoute, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org