diff contrib/perf.py @ 51064:47d43efda8b7

revlog: remove legacy usage of `_withsparseread` All core code is now getting the setting from the DeltaConfig object.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 10 Oct 2023 11:24:37 +0200
parents ffb393dd5999
children 26dcdbe15024
line wrap: on
line diff
--- a/contrib/perf.py	Tue Oct 10 11:16:07 2023 +0200
+++ b/contrib/perf.py	Tue Oct 10 11:24:37 2023 +0200
@@ -3983,7 +3983,13 @@
 
     size = r.length(rev)
     chain = r._deltachain(rev)[0]
-    if not getattr(r, '_withsparseread', False):
+
+    with_sparse_read = False
+    if hasattr(r, 'data_config'):
+        with_sparse_read = r.data_config.with_sparse_read
+    elif hasattr(r, '_withsparseread'):
+        with_sparse_read = r._withsparseread
+    if with_sparse_read:
         slicedchain = (chain,)
     else:
         slicedchain = tuple(slicechunk(r, chain, targetsize=size))
@@ -4000,7 +4006,7 @@
         (lambda: doread(chain), b'read'),
     ]
 
-    if getattr(r, '_withsparseread', False):
+    if with_sparse_read:
         slicing = (lambda: doslice(r, chain, size), b'slice-sparse-chain')
         benches.append(slicing)