Show More
@@ -2046,6 +2046,19 b' def perfstartup(ui, repo, **opts):' | |||
|
2046 | 2046 | fm.end() |
|
2047 | 2047 | |
|
2048 | 2048 | |
|
2049 | def _clear_store_audit_cache(repo): | |
|
2050 | vfs = getsvfs(repo) | |
|
2051 | # unwrap the fncache proxy | |
|
2052 | if not hasattr(vfs, "audit"): | |
|
2053 | vfs = getattr(vfs, "vfs", vfs) | |
|
2054 | auditor = vfs.audit | |
|
2055 | if hasattr(auditor, "clear_audit_cache"): | |
|
2056 | auditor.clear_audit_cache() | |
|
2057 | elif hasattr(auditor, "audited"): | |
|
2058 | auditor.audited.clear() | |
|
2059 | auditor.auditeddir.clear() | |
|
2060 | ||
|
2061 | ||
|
2049 | 2062 | def _find_stream_generator(version): |
|
2050 | 2063 | """find the proper generator function for this stream version""" |
|
2051 | 2064 | import mercurial.streamclone |
@@ -2119,6 +2132,9 b' def perf_stream_clone_scan(ui, repo, str' | |||
|
2119 | 2132 | |
|
2120 | 2133 | def setupone(): |
|
2121 | 2134 | result_holder[0] = None |
|
2135 | # This is important for the full generation, even if it does not | |
|
2136 | # currently matters, it seems safer to also real it here. | |
|
2137 | _clear_store_audit_cache(repo) | |
|
2122 | 2138 | |
|
2123 | 2139 | generate = _find_stream_generator(stream_version) |
|
2124 | 2140 | |
@@ -2154,12 +2170,15 b' def perf_stream_clone_generate(ui, repo,' | |||
|
2154 | 2170 | |
|
2155 | 2171 | generate = _find_stream_generator(stream_version) |
|
2156 | 2172 | |
|
2173 | def setup(): | |
|
2174 | _clear_store_audit_cache(repo) | |
|
2175 | ||
|
2157 | 2176 | def runone(): |
|
2158 | 2177 | # the lock is held for the duration the initialisation |
|
2159 | 2178 | for chunk in generate(repo): |
|
2160 | 2179 | pass |
|
2161 | 2180 | |
|
2162 | timer(runone, title=b"generate") | |
|
2181 | timer(runone, setup=setup, title=b"generate") | |
|
2163 | 2182 | fm.end() |
|
2164 | 2183 | |
|
2165 | 2184 |
@@ -180,6 +180,13 b' class pathauditor:' | |||
|
180 | 180 | self.auditeddir.clear() |
|
181 | 181 | self._cached = False |
|
182 | 182 | |
|
183 | def clear_audit_cache(self): | |
|
184 | """reset all audit cache | |
|
185 | ||
|
186 | intended for debug and performance benchmark purposes""" | |
|
187 | self.audited.clear() | |
|
188 | self.auditeddir.clear() | |
|
189 | ||
|
183 | 190 | |
|
184 | 191 | def canonpath( |
|
185 | 192 | root: bytes, |
General Comments 0
You need to be logged in to leave comments.
Login now