##// END OF EJS Templates
perf: node lookup
Matt Mackall -
r16309:e0c1b3ef default
parent child Browse files
Show More
@@ -111,6 +111,15 b' def perfparents(ui, repo):'
111 111 def perflookup(ui, repo, rev):
112 112 timer(lambda: len(repo.lookup(rev)))
113 113
114 def perfnodelookup(ui, repo, rev):
115 import mercurial.revlog
116 mercurial.revlog._prereadsize = 2**24 # disable lazy parser in old hg
117 n = repo[rev].node()
118 def d():
119 cl = mercurial.revlog.revlog(repo.sopener, "00changelog.i")
120 cl.rev(n)
121 timer(d)
122
114 123 def perflog(ui, repo, **opts):
115 124 ui.pushbuffer()
116 125 timer(lambda: commands.log(ui, repo, rev=[], date='', user='',
@@ -153,6 +162,7 b' def perfrevlog(ui, repo, file_, **opts):'
153 162
154 163 cmdtable = {
155 164 'perflookup': (perflookup, []),
165 'perfnodelookup': (perfnodelookup, []),
156 166 'perfparents': (perfparents, []),
157 167 'perfstartup': (perfstartup, []),
158 168 'perfstatus': (perfstatus, []),
General Comments 0
You need to be logged in to leave comments. Login now