diff contrib/perf.py @ 51091:a82704902db8

revlog: move the compression/decompression logic on the inner object This is a necessary step before being able to move more logic around restoring a revision content there. For now, we do a simple patch for the perf extension logic, when the implementation of the inner object changes, we will likely need some evolution of the API. However this is true of many things in the perf extension. So we will see this later.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 25 Oct 2023 02:13:18 +0200
parents df50a1592e0c
children 9c8df10ea6e0
line wrap: on
line diff
--- a/contrib/perf.py	Mon Oct 23 14:27:07 2023 +0200
+++ b/contrib/perf.py	Wed Oct 25 02:13:18 2023 +0200
@@ -3833,14 +3833,16 @@
     def docompress(compressor):
         rl.clearcaches()
 
+        compressor_holder = getattr(rl, '_inner', rl)
+
         try:
             # Swap in the requested compression engine.
-            oldcompressor = rl._compressor
-            rl._compressor = compressor
+            oldcompressor = compressor_holder._compressor
+            compressor_holder._compressor = compressor
             for chunk in chunks[0]:
                 rl.compress(chunk)
         finally:
-            rl._compressor = oldcompressor
+            compressor_holder._compressor = oldcompressor
 
     benches = [
         (lambda: doread(), b'read'),