Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions src/borg/archiver/benchmark_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import time

from ..constants import * # NOQA
from ..crypto.key import FlexiKey
from ..helpers import format_file_size, CompressionSpec
from ..helpers import json_print
from ..helpers import msgpack
Expand Down Expand Up @@ -170,7 +169,6 @@ def do_benchmark_cpu(self, args):
# Use minimal iterations and data size in test mode to keep CI fast.
number_default = 1 if is_test else 100
number_compression = 1 if is_test else 10
number_kdf = 1 if is_test else 5
data_size = 100 * 1000 if is_test else 10 * 1000 * 1000

random_10M = os.urandom(data_size)
Expand Down Expand Up @@ -288,20 +286,6 @@ def chunkit(ch):
else:
print(f"{spec:<24} {format_file_size(size):<10} {dt:.3f}s")

if not args.json:
print("KDFs (slow is GOOD, use argon2!) ===============================")
else:
result["kdf"] = []
for spec, func in [
("pbkdf2", lambda: FlexiKey.pbkdf2("mypassphrase", b"salt" * 8, PBKDF2_ITERATIONS, 32)),
("argon2", lambda: FlexiKey.argon2("mypassphrase", 64, b"S" * ARGON2_SALT_BYTES, **ARGON2_ARGS)),
]:
dt = timeit(func, number=number_kdf)
if args.json:
result["kdf"].append({"algo": spec, "count": number_kdf, "time": dt})
else:
print(f"{spec:<24} {number_kdf:<10} {dt:.3f}s")

if not args.json:
print("Compression ====================================================")
else:
Expand Down
3 changes: 1 addition & 2 deletions src/borg/testsuite/archiver/benchmark_cmd_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ def test_benchmark_cpu(archiver, monkeypatch):
assert "Non-cryptographic checksums / hashes" in output
assert "Cryptographic hashes / MACs" in output
assert "Encryption" in output
assert "KDFs" in output
assert "Compression" in output
assert "msgpack" in output

Expand All @@ -76,7 +75,7 @@ def test_benchmark_cpu_json(archiver, monkeypatch):
for entry in result[category]:
assert "algo_params" in entry
# categories with "count" field
for category in ["kdf", "msgpack"]:
for category in ["msgpack"]:
assert isinstance(result[category], list)
assert len(result[category]) > 0
for entry in result[category]:
Expand Down
Loading