pub struct TournamentConfig {
pub codecs: Vec<String>,
pub min_size_threshold: u32,
pub skip_for_binary: bool,
pub short_circuit_threshold: u32,
}Expand description
Compression tournament settings.
Fields§
§codecs: Vec<String>Codecs to try in the tournament (ordered fast → slow).
The writer iterates these in order and stops early when
short_circuit_threshold is met.
min_size_threshold: u32Minimum chunk size for the tournament to try a codec.
skip_for_binary: boolSkip tournament for binary class (use binary_codec directly).
short_circuit_threshold: u32Short-circuit the tournament once a codec achieves this ratio or better. Stored as per-mille (parts per 1000) so it serialises as an integer — 250 means “accept the moment a codec reaches 25% of original size”. 0 disables short-circuit (try every codec).
For example, on a highly-compressible CSV chunk, LZ4 typically reaches ~10% ratio in microseconds; the short-circuit lets us accept that and skip the much-slower Brotli pass we would otherwise run for ratio parity. On hard-to-compress text where LZ4 only reaches ~40%, the tournament continues to Brotli to preserve ratio.
Trait Implementations§
Source§impl Clone for TournamentConfig
impl Clone for TournamentConfig
Source§fn clone(&self) -> TournamentConfig
fn clone(&self) -> TournamentConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TournamentConfig
impl Debug for TournamentConfig
Source§impl<'de> Deserialize<'de> for TournamentConfig
impl<'de> Deserialize<'de> for TournamentConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for TournamentConfig
Source§impl PartialEq for TournamentConfig
impl PartialEq for TournamentConfig
Source§impl Serialize for TournamentConfig
impl Serialize for TournamentConfig
impl StructuralPartialEq for TournamentConfig
Auto Trait Implementations§
impl Freeze for TournamentConfig
impl RefUnwindSafe for TournamentConfig
impl Send for TournamentConfig
impl Sync for TournamentConfig
impl Unpin for TournamentConfig
impl UnsafeUnpin for TournamentConfig
impl UnwindSafe for TournamentConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more