From 9e408a9b3a08d14d2caf2de690ead94ecf3e03a0 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Thu, 28 May 2026 18:56:47 +0200 Subject: [PATCH] benchmark: remove xxh64 and crc32 benchmarking Likely we will use them less or not at all in future. --- src/borg/archiver/benchmark_cmd.py | 16 ---------------- .../testsuite/archiver/benchmark_cmd_test.py | 3 +-- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/src/borg/archiver/benchmark_cmd.py b/src/borg/archiver/benchmark_cmd.py index b81b763f6..1eb6bdba9 100644 --- a/src/borg/archiver/benchmark_cmd.py +++ b/src/borg/archiver/benchmark_cmd.py @@ -213,22 +213,6 @@ class BenchmarkMixIn: else: print(f"{spec:<24} {format_file_size(size):<10} {dt:.3f}s") - from xxhash import xxh64 - from zlib import crc32 - - if not args.json: - print("Non-cryptographic checksums / hashes ===========================") - else: - result["checksums"] = [] - size = 1000000000 - tests = [("xxh64", lambda: xxh64(random_10M).digest()), ("crc32 (zlib)", lambda: crc32(random_10M))] - for spec, func in tests: - dt = timeit(func, number=number_default) - if args.json: - result["checksums"].append({"algo": spec, "size": size, "time": dt}) - else: - print(f"{spec:<24} {format_file_size(size):<10} {dt:.3f}s") - from ..crypto.low_level import hmac_sha256, blake2b_256 if not args.json: diff --git a/src/borg/testsuite/archiver/benchmark_cmd_test.py b/src/borg/testsuite/archiver/benchmark_cmd_test.py index 5d01b1cbd..5e0375fa2 100644 --- a/src/borg/testsuite/archiver/benchmark_cmd_test.py +++ b/src/borg/testsuite/archiver/benchmark_cmd_test.py @@ -50,7 +50,6 @@ def test_benchmark_cpu(archiver, monkeypatch): output = cmd(archiver, "benchmark", "cpu") # verify all section headers appear in the plain-text output assert "Chunkers" in output - assert "Non-cryptographic checksums / hashes" in output assert "Cryptographic hashes / MACs" in output assert "Encryption" in output assert "Compression" in output @@ -63,7 +62,7 @@ def test_benchmark_cpu_json(archiver, monkeypatch): result = json.loads(output) assert isinstance(result, dict) # categories with "size" field (bytes) - for category in ["chunkers", "checksums", "hashes", "encryption"]: + for category in ["chunkers", "hashes", "encryption"]: assert isinstance(result[category], list) assert len(result[category]) > 0 for entry in result[category]: