mirror of
https://github.com/borgbackup/borg.git
synced 2026-06-11 01:41:57 -04:00
benchmark: remove xxh64 and crc32 benchmarking
Likely we will use them less or not at all in future.
This commit is contained in:
parent
53b48f0940
commit
9e408a9b3a
2 changed files with 1 additions and 18 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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]:
|
||||
|
|
|
|||
Loading…
Reference in a new issue