Patchwork [1,of,4] perf: add a perfloadmarkers command

login
register
mail settings
Submitter Pierre-Yves David
Date Nov. 30, 2014, 1:57 a.m.
Message ID <04eb7e49d2b6f90f71aa.1417312661@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/6891/
State Superseded
Headers show

Comments

Pierre-Yves David - Nov. 30, 2014, 1:57 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1416529675 28800
#      Thu Nov 20 16:27:55 2014 -0800
# Node ID 04eb7e49d2b6f90f71aa85de9ad0b4d70670d688
# Parent  9da5a7413eb8bc3e708eee62bc38342c8ff7f917
perf: add a perfloadmarkers command

It is used to perfmark the obsstore initialisation time.
Matt Mackall - Dec. 5, 2014, 8:43 p.m.
On Sat, 2014-11-29 at 17:57 -0800, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@fb.com>
> # Date 1416529675 28800
> #      Thu Nov 20 16:27:55 2014 -0800
> # Node ID 04eb7e49d2b6f90f71aa85de9ad0b4d70670d688
> # Parent  9da5a7413eb8bc3e708eee62bc38342c8ff7f917
> perf: add a perfloadmarkers command

Queued for default, thanks.

Patch

diff --git a/contrib/perf.py b/contrib/perf.py
--- a/contrib/perf.py
+++ b/contrib/perf.py
@@ -523,5 +523,14 @@  def perfbranchmap(ui, repo, full=False):
             timer(getbranchmap(name), title=str(name))
     finally:
         branchmap.read = oldread
         branchmap.branchcache.write = oldwrite
     fm.end()
+
+@command('perfloadmarkers')
+def perfloadmarkers(ui, repo):
+    """benchmark the time to parse the ondisk marker for a repo
+
+    Result is the number of marker in the repo."""
+    timer, fm = gettimer(ui)
+    timer(lambda: len(obsolete.obsstore(repo.sopener)))
+    fm.end()