Simplify and tune defaults

This commit is contained in:
Dominik Werder
2023-07-25 14:51:39 +02:00
parent 7c26b72537
commit 952e92101c
5 changed files with 159 additions and 19 deletions
+7 -4
View File
@@ -913,7 +913,7 @@ mod serde_shape {
{
use Shape::*;
match self {
Scalar => ser.collect_seq([0u32; 0].iter()),
Scalar => ser.collect_seq(std::iter::empty::<u32>()),
Wave(a) => ser.collect_seq([*a].iter()),
Image(a, b) => ser.collect_seq([*a, *b].iter()),
}
@@ -2353,11 +2353,12 @@ pub enum ReadSys {
Read3,
Read4,
Read5,
BlockingTaskIntoChannel,
}
impl ReadSys {
pub fn default() -> Self {
Self::TokioAsyncRead
Self::BlockingTaskIntoChannel
}
}
@@ -2373,6 +2374,8 @@ impl From<&str> for ReadSys {
Self::Read4
} else if k == "Read5" {
Self::Read5
} else if k == "BlockingTaskIntoChannel" {
Self::BlockingTaskIntoChannel
} else {
Self::default()
}
@@ -2390,7 +2393,7 @@ impl DiskIoTune {
pub fn default_for_testing() -> Self {
Self {
read_sys: ReadSys::default(),
read_buffer_len: 1024 * 4,
read_buffer_len: 1024 * 8,
read_queue_len: 4,
}
}
@@ -2398,7 +2401,7 @@ impl DiskIoTune {
pub fn default() -> Self {
Self {
read_sys: ReadSys::default(),
read_buffer_len: 1024 * 4,
read_buffer_len: 1024 * 16,
read_queue_len: 4,
}
}
+2 -2
View File
@@ -263,8 +263,8 @@ impl Api1Query {
if let Some(x) = &self.file_io_buffer_size {
k.read_buffer_len = x.0;
}
if let Some(io_queue_len) = self.io_queue_len {
k.read_queue_len = io_queue_len as usize;
if let Some(x) = self.io_queue_len {
k.read_queue_len = x as usize;
}
let read_sys: ReadSys = self.read_sys.as_str().into();
k.read_sys = read_sys;