mirror of
https://git.proxmox.com/git/proxmox-backup
synced 2025-04-30 16:14:00 +00:00
client: avoid unnecessary allocation in AES benchmark
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
This commit is contained in:
parent
deb237a288
commit
eb44bdb842
@ -331,9 +331,10 @@ fn test_crypt_speed(benchmark_result: &mut BenchmarkResult) -> Result<(), Error>
|
|||||||
let start_time = std::time::Instant::now();
|
let start_time = std::time::Instant::now();
|
||||||
|
|
||||||
let mut bytes = 0;
|
let mut bytes = 0;
|
||||||
loop {
|
|
||||||
let mut out = Vec::new();
|
let mut out = Vec::new();
|
||||||
|
loop {
|
||||||
DataBlob::encrypt_benchmark(&crypt_config, &random_data, &mut out)?;
|
DataBlob::encrypt_benchmark(&crypt_config, &random_data, &mut out)?;
|
||||||
|
out.clear();
|
||||||
bytes += random_data.len();
|
bytes += random_data.len();
|
||||||
if start_time.elapsed().as_micros() > 1_000_000 {
|
if start_time.elapsed().as_micros() > 1_000_000 {
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user