Expand Shadowsocks runtime compatibility
This commit is contained in:
parent
d1638726ca
commit
4d1f589280
167 changed files with 57173 additions and 1640 deletions
26
third_party/rustls-fork-shadow-tls/benches/benchmarks.rs
vendored
Normal file
26
third_party/rustls-fork-shadow-tls/benches/benchmarks.rs
vendored
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
use criterion::criterion_group;
|
||||
use criterion::criterion_main;
|
||||
/// Microbenchmarks go here. Larger benchmarks of (e.g..) protocol
|
||||
/// performance go in examples/internal/bench.rs.
|
||||
use criterion::Criterion;
|
||||
|
||||
#[path = "../tests/common/mod.rs"]
|
||||
mod test_utils;
|
||||
use test_utils::*;
|
||||
|
||||
use rustls::ServerConnection;
|
||||
|
||||
use std::io;
|
||||
use std::sync::Arc;
|
||||
|
||||
fn bench_ewouldblock(c: &mut Criterion) {
|
||||
let server_config = make_server_config(KeyType::Rsa);
|
||||
let mut server = ServerConnection::new(Arc::new(server_config)).unwrap();
|
||||
let mut read_ewouldblock = FailsReads::new(io::ErrorKind::WouldBlock);
|
||||
c.bench_function("read_tls with EWOULDBLOCK", move |b| {
|
||||
b.iter(|| server.read_tls(&mut read_ewouldblock))
|
||||
});
|
||||
}
|
||||
|
||||
criterion_group!(benches, bench_ewouldblock);
|
||||
criterion_main!(benches);
|
||||
Loading…
Add table
Add a link
Reference in a new issue