# HG changeset patch # User Pierre-Yves David # Date 1712151205 -7200 # Node ID 8e8776a28683ceeac2e6f0da1a0116bc0591003b # Parent c4aab3661f254d0619aeaafbbfde89c124c784eb perf: create the temporary target next to the source in stream-consume See inline comment for rational. diff -r c4aab3661f25 -r 8e8776a28683 contrib/perf.py --- a/contrib/perf.py Tue Apr 02 21:53:17 2024 +0200 +++ b/contrib/perf.py Wed Apr 03 15:33:25 2024 +0200 @@ -2188,10 +2188,18 @@ run_variables = [None, None] + # we create the new repository next to the other one for two reasons: + # - this way we use the same file system, which are relevant for benchmark + # - if /tmp/ is small, the operation could overfills it. + source_repo_dir = os.path.dirname(repo.root) + @contextlib.contextmanager def context(): with open(filename, mode='rb') as bundle: - with tempfile.TemporaryDirectory() as tmp_dir: + with tempfile.TemporaryDirectory( + prefix=b'hg-perf-stream-consume-', + dir=source_repo_dir, + ) as tmp_dir: tmp_dir = fsencode(tmp_dir) run_variables[0] = bundle run_variables[1] = tmp_dir