Driver, Input: Performance & Benchmarks (#27)
* Driver Benchmarks Benchmarks driver use cases for single packet send, multiple packet send, float vs opus, and the cost of head-of-queue track removal. Mix costs for large packet counts are also included. This is a prelude to the optimisations discussed in #21. * Typo in benchmark * Place Opus packet directly into packet buffer Cleans up some other logic surrounding this, too. Gets a 16.9% perf improvement on opus packet passthrough (sub 5us here). * Better track removal In theory this should be faster, but it aint. Keeping in case reducing struct sizes down the line magically makes this faster. * Reduce size of Input, TrackHandle Metadata is now boxed away. Similarly, TrackHandles are neatly Arc'd to reduce their size to pointer length (and mitigate the impact of copies if we add in more fields).
This commit is contained in:
14
Cargo.toml
14
Cargo.toml
@@ -158,10 +158,18 @@ serenity-deps = ["async-trait"]
|
||||
youtube-dlc = []
|
||||
builtin-queue = []
|
||||
|
||||
internals = []
|
||||
|
||||
[[bench]]
|
||||
name = "mixing"
|
||||
path = "benches/mixing.rs"
|
||||
name = "base-mixing"
|
||||
path = "benches/base-mixing.rs"
|
||||
harness = false
|
||||
|
||||
[[bench]]
|
||||
name = "mixing-task"
|
||||
path = "benches/mixing-task.rs"
|
||||
required-features = ["internals"]
|
||||
harness = false
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
features = ["default", "twilight-rustls", "builtin-queue", "stock-zlib"]
|
||||
|
||||
Reference in New Issue
Block a user