Merge pull request #9665 from mr-raj12/benchmark-drop-kdf-section
Some checks are pending
Lint / lint (push) Waiting to run
CI / lint (push) Waiting to run
CI / security (push) Waiting to run
CI / asan_ubsan (push) Blocked by required conditions
CI / native_tests (push) Blocked by required conditions
CI / vm_tests (Haiku, false, haiku, r1beta5) (push) Blocked by required conditions
CI / vm_tests (NetBSD, false, netbsd, 10.1) (push) Blocked by required conditions
CI / vm_tests (OmniOS, false, omnios, r151056) (push) Blocked by required conditions
CI / vm_tests (OpenBSD, false, openbsd, 7.8) (push) Blocked by required conditions
CI / vm_tests (borg-freebsd-14-x86_64-gh, FreeBSD, true, freebsd, 14.3) (push) Blocked by required conditions
CI / windows_tests (push) Blocked by required conditions
CodeQL / Analyze (push) Waiting to run

benchmark cpu: drop KDF section
This commit is contained in:
TW 2026-05-24 08:01:53 +02:00 committed by GitHub
commit 832bb44693
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 1 additions and 18 deletions

View file

@ -6,7 +6,6 @@ import tempfile
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
@ -170,7 +169,6 @@ class BenchmarkMixIn:
# 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)
@ -288,20 +286,6 @@ class BenchmarkMixIn:
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:

View file

@ -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
@ -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]: