1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-02-13 01:45:56 +00:00

Merge pull request #6495 from ThomasWaldmann/kdf-timings

borg benchmark cpu: add kdf timings
This commit is contained in:
TW 2022-03-26 20:29:45 +01:00 committed by GitHub
commit 312cae5ebb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -611,6 +611,15 @@ def chunkit(chunker_name, *args, **kwargs):
for spec, func in tests:
print(f"{spec:<24} {size:<10} {timeit(func, number=100):.3f}s")
from borg.helpers.passphrase import Passphrase
print("KDFs (slow is GOOD, use argon2!) ===============================")
count = 5
for spec, func in [
("pbkdf2", lambda: Passphrase('mypassphrase').kdf(b'salt'*8, PBKDF2_ITERATIONS, 32)),
("argon2", lambda: Passphrase('mypassphrase').argon2(32, b'salt'*8, 3, 65536, 1, 'id')),
]:
print(f"{spec:<24} {count:<10} {timeit(func, number=count):.3f}s")
from borg.compress import CompressionSpec
print("Compression ====================================================")
for spec in [