azalea/azalea-crypto/benches/my_benchmark.rs
mat 6eee543a33
Pathfinder (#25)
Pathfinding is very much not done, but it works enough and I want to get this merged.
TODO: fast replanning, goals that aren't a single node, falling moves (it should be able to play the dropper), parkour moves
2022-11-12 23:54:05 -06:00

24 lines
680 B
Rust
Executable file

use azalea_crypto::{create_cipher, decrypt_packet, encrypt_packet};
use criterion::{criterion_group, criterion_main, Criterion};
fn bench(c: &mut Criterion) {
let (mut enc, dec) = create_cipher(b"0123456789abcdef");
let mut packet = [0u8; 65536];
for i in 0..packet.len() {
packet[i] = i as u8;
}
c.bench_function("Encrypt 64kb", |b| {
b.iter(|| encrypt_packet(&mut enc.clone(), &mut packet.clone()))
});
encrypt_packet(&mut enc, &mut packet);
c.bench_function("Decrypt 64kb", |b| {
b.iter(|| decrypt_packet(&mut dec.clone(), &mut packet.clone()))
});
}
criterion_group!(benches, bench);
criterion_main!(benches);