comparison mercurial/revset.py @ 41222:8aca89a694d4

revset: introduce an API that avoids `formatspec` input serialization Instead of having the data fully serialized, the input can be directly inserted in the tree at a later stage. Just using it for simple "%ld" case provide a significant boost. For example here are the impact on a sample discovery run between two pypy repositories with arbitrary differences (using hg perfdiscovery). $ hg perfdiscovery before: ! wall 0.700435 comb 0.710000 user 0.700000 sys 0.010000 (median of 15) after: ! wall 0.501305 comb 0.510000 user 0.490000 sys 0.020000 (median of 20)
author Boris Feld <boris.feld@octobus.net>
date Fri, 04 Jan 2019 13:41:21 +0100
parents e54bfde922f2
children 4c6fdc7e2e7d
comparison
equal deleted inserted replaced
41221:73203cdfe3fe 41222:8aca89a694d4
123 if (x in subset 123 if (x in subset
124 or x == node.nullrev and isinstance(subset, fullreposet)): 124 or x == node.nullrev and isinstance(subset, fullreposet)):
125 return baseset([x]) 125 return baseset([x])
126 return baseset() 126 return baseset()
127 127
128 def rawsmartset(repo, subset, x, order):
129 """argument is already a smartset, use that directly"""
130 if order == followorder:
131 return subset & x
132 else:
133 return x & subset
134
128 def rangeset(repo, subset, x, y, order): 135 def rangeset(repo, subset, x, y, order):
129 m = getset(repo, fullreposet(repo), x) 136 m = getset(repo, fullreposet(repo), x)
130 n = getset(repo, fullreposet(repo), y) 137 n = getset(repo, fullreposet(repo), y)
131 138
132 if not m or not n: 139 if not m or not n:
2214 "keyvalue": keyvaluepair, 2221 "keyvalue": keyvaluepair,
2215 "func": func, 2222 "func": func,
2216 "ancestor": ancestorspec, 2223 "ancestor": ancestorspec,
2217 "parent": parentspec, 2224 "parent": parentspec,
2218 "parentpost": parentpost, 2225 "parentpost": parentpost,
2226 "smartset": rawsmartset,
2219 } 2227 }
2220 2228
2221 subscriptrelations = { 2229 subscriptrelations = {
2222 "g": generationsrel, 2230 "g": generationsrel,
2223 "generations": generationsrel, 2231 "generations": generationsrel,