File: merge_cert.rs

package info (click to toggle)
rust-sequoia-openpgp 2.0.0-4
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 9,548 kB
  • sloc: sh: 6; makefile: 2
file content (20 lines) | stat: -rw-r--r-- 582 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use criterion::{
    criterion_group, Criterion,
};

use sequoia_openpgp as openpgp;
use openpgp::cert::Cert;
use openpgp::parse::Parse;

/// Benchmark merging a typical cert with itself.
fn bench_merge_certs(c: &mut Criterion) {
    let mut group = c.benchmark_group("merge cert with itself");
    let neal = Cert::from_bytes(include_bytes!("../tests/data/keys/neal.pgp"))
        .unwrap();
    group.bench_function("neal.pgp", |b| b.iter(|| {
        neal.clone().merge_public(neal.clone()).unwrap();
    }));
    group.finish();
}

criterion_group!(benches, bench_merge_certs);