mirror of
https://github.com/wisdgod/cursor-api.git
synced 2025-10-07 07:31:56 +08:00
0.3.6: WIP
This commit is contained in:
23
patch/rustls-0.23.27/benches/benchmarks.rs
Normal file
23
patch/rustls-0.23.27/benches/benchmarks.rs
Normal file
@@ -0,0 +1,23 @@
|
||||
#![cfg(feature = "ring")]
|
||||
#![allow(clippy::disallowed_types)]
|
||||
|
||||
use bencher::{Bencher, benchmark_group, benchmark_main};
|
||||
use rustls::crypto::ring as provider;
|
||||
|
||||
#[path = "../tests/common/mod.rs"]
|
||||
mod test_utils;
|
||||
use std::io;
|
||||
use std::sync::Arc;
|
||||
|
||||
use rustls::ServerConnection;
|
||||
use test_utils::*;
|
||||
|
||||
fn bench_ewouldblock(c: &mut Bencher) {
|
||||
let server_config = make_server_config(KeyType::Rsa2048);
|
||||
let mut server = ServerConnection::new(Arc::new(server_config)).unwrap();
|
||||
let mut read_ewouldblock = FailsReads::new(io::ErrorKind::WouldBlock);
|
||||
c.iter(|| server.read_tls(&mut read_ewouldblock));
|
||||
}
|
||||
|
||||
benchmark_group!(benches, bench_ewouldblock);
|
||||
benchmark_main!(benches);
|
Reference in New Issue
Block a user