mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 09:45:31 +00:00
Move benchmarks to seperate crate "aquatic_bench"
This commit is contained in:
parent
a627594c3a
commit
165214018c
13 changed files with 40 additions and 34 deletions
13
Cargo.lock
generated
13
Cargo.lock
generated
|
|
@ -28,11 +28,20 @@ dependencies = [
|
|||
"mimalloc",
|
||||
"mio",
|
||||
"net2",
|
||||
"num-format",
|
||||
"plotly",
|
||||
"quickcheck",
|
||||
"quickcheck_macros",
|
||||
"rand",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "aquatic_bench"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"aquatic",
|
||||
"mimalloc",
|
||||
"num-format",
|
||||
"plotly",
|
||||
"rand",
|
||||
"rand_distr",
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -3,15 +3,9 @@
|
|||
members = [
|
||||
"bittorrent_udp",
|
||||
"aquatic",
|
||||
"aquatic_bench",
|
||||
]
|
||||
|
||||
[profile.dev]
|
||||
debug = true
|
||||
|
||||
[profile.release]
|
||||
debug = true
|
||||
lto = true
|
||||
|
||||
[profile.bench]
|
||||
opt-level = 3
|
||||
lto = true
|
||||
2
TODO.md
2
TODO.md
|
|
@ -6,9 +6,7 @@
|
|||
* Cleaner code
|
||||
* Stack-allocated vector?
|
||||
* Benchmarks
|
||||
* Move to own crate (aquatic_bench)
|
||||
* Better black_box (or make sure to consume data)
|
||||
* Show standard deviation?
|
||||
* Send in connect reponse ids to other functions as integration test
|
||||
* target-cpu=native
|
||||
|
||||
|
|
|
|||
|
|
@ -11,31 +11,14 @@ path = "src/lib/lib.rs"
|
|||
[[bin]]
|
||||
name = "aquatic"
|
||||
|
||||
[[bin]]
|
||||
name = "bench_handlers"
|
||||
|
||||
[[bin]]
|
||||
name = "plot_pareto"
|
||||
|
||||
[dependencies]
|
||||
bittorrent_udp = { path = "../bittorrent_udp" }
|
||||
dashmap = "3"
|
||||
indexmap = "1"
|
||||
mimalloc = "0.1"
|
||||
mio = { version = "0.7", features = ["udp", "os-poll", "os-util"] }
|
||||
net2 = "0.2"
|
||||
|
||||
# bench_handlers / plot_pareto
|
||||
num-format = "0.4"
|
||||
rand_distr = "0.2"
|
||||
plotly = "0.4"
|
||||
|
||||
[dependencies.mio]
|
||||
version = "0.7"
|
||||
features = ["udp", "os-poll", "os-util"]
|
||||
|
||||
[dependencies.rand]
|
||||
version = "0.7"
|
||||
features = ["small_rng"]
|
||||
rand = { version = "0.7", features = ["small_rng"] }
|
||||
|
||||
[dev-dependencies]
|
||||
quickcheck = "0.9"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
use std::time::Duration;
|
||||
|
||||
pub mod bench_utils;
|
||||
pub mod common;
|
||||
pub mod handlers;
|
||||
pub mod network;
|
||||
|
|
|
|||
23
aquatic_bench/Cargo.toml
Normal file
23
aquatic_bench/Cargo.toml
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
|
||||
[package]
|
||||
name = "aquatic_bench"
|
||||
version = "0.1.0"
|
||||
authors = ["Joakim Frostegård <joakim.frostegard@gmail.com>"]
|
||||
edition = "2018"
|
||||
|
||||
[lib]
|
||||
name = "aquatic_bench"
|
||||
|
||||
[[bin]]
|
||||
name = "bench_handlers"
|
||||
|
||||
[[bin]]
|
||||
name = "plot_pareto"
|
||||
|
||||
[dependencies]
|
||||
aquatic = { path = "../aquatic" }
|
||||
mimalloc = "0.1"
|
||||
num-format = "0.4"
|
||||
plotly = "0.4"
|
||||
rand_distr = "0.2"
|
||||
rand = { version = "0.7", features = ["small_rng"] }
|
||||
|
|
@ -4,9 +4,9 @@ use std::net::SocketAddr;
|
|||
use rand::Rng;
|
||||
use rand_distr::Pareto;
|
||||
|
||||
use aquatic::bench_utils::*;
|
||||
use aquatic::handlers::*;
|
||||
use aquatic::common::*;
|
||||
use aquatic_bench::*;
|
||||
|
||||
use crate::common::*;
|
||||
|
||||
|
|
@ -4,9 +4,9 @@ use std::net::SocketAddr;
|
|||
use rand::Rng;
|
||||
use rand_distr::Pareto;
|
||||
|
||||
use aquatic::bench_utils::*;
|
||||
use aquatic::handlers::*;
|
||||
use aquatic::common::*;
|
||||
use aquatic_bench::*;
|
||||
|
||||
use crate::common::*;
|
||||
|
||||
|
|
@ -4,7 +4,7 @@ use plotly::layout::Axis;
|
|||
use rand::{thread_rng, rngs::SmallRng, SeedableRng};
|
||||
use rand_distr::Pareto;
|
||||
|
||||
use aquatic::bench_utils::pareto_usize;
|
||||
use aquatic_bench::pareto_usize;
|
||||
|
||||
|
||||
fn main(){
|
||||
Loading…
Add table
Add a link
Reference in a new issue