pub struct GOBuildConf<GS: GroupSize = TwoToPowerBitsStatic<4>, SS: SeedSize = TwoToPowerBitsStatic<2>, S = BuildDefaultSeededHasher> {
pub cache_threshold: usize,
pub relative_level_size: u16,
pub use_multiple_threads: bool,
pub goconf: GOConf<GS, SS, S>,
}Expand description
Build configuration that is accepted by GOFunction constructors.
See field descriptions for details.
Fields§
§cache_threshold: usizeThe threshold for the number of keys below which their hashes will be cached during level construction.
(default: GOBuildConf::DEFAULT_CACHE_THRESHOLD)
Caching speeds up level construction at the expense of memory consumption during construction
(caching a single key requires 8 bytes of memory).
Caching is particularly recommended for keys with complex types whose hashing is slow.
It is possible to use a value of 0 to disable caching completely, or usize::MAX to use it on all levels.
relative_level_size: u16Size of each level given as a percentage of the number of level input keys. (default: 100)
A value of 100 minimizes the size of the constructed minimum perfect hash function. Larger values speed up evaluation at the expense of increased size. It does not make sense to use values below 100.
use_multiple_threads: boolWhether to use multiple threads during construction. (default: true)
If true, the construction will be performed using the default rayon thread pool.
goconf: GOConf<GS, SS, S>Configuration of family of (group-optimized) hash functions (default: GOConf::default).
Implementations§
Source§impl<GS: GroupSize + Sync, SS: SeedSize, S: BuildSeededHasher + Sync> GOBuildConf<GS, SS, S>
impl<GS: GroupSize + Sync, SS: SeedSize, S: BuildSeededHasher + Sync> GOBuildConf<GS, SS, S>
Sourcepub const DEFAULT_CACHE_THRESHOLD: usize
pub const DEFAULT_CACHE_THRESHOLD: usize
The default value for relative_level_size,
which results in building the cache with a maximum size of 1GB.
Sourcepub fn with_lsize_ct_mt(
goconf: GOConf<GS, SS, S>,
relative_level_size: u16,
cache_threshold: usize,
use_multiple_threads: bool,
) -> Self
pub fn with_lsize_ct_mt( goconf: GOConf<GS, SS, S>, relative_level_size: u16, cache_threshold: usize, use_multiple_threads: bool, ) -> Self
Returns configuration with custom group-optimized family of hash functions, relative level size, cache threshold and potentially enabled multiple threads.
Sourcepub fn new(goconf: GOConf<GS, SS, S>) -> Self
pub fn new(goconf: GOConf<GS, SS, S>) -> Self
Returns configuration with custom group-optimized family of hash functions.
Sourcepub fn with_ct(goconf: GOConf<GS, SS, S>, cache_threshold: usize) -> Self
pub fn with_ct(goconf: GOConf<GS, SS, S>, cache_threshold: usize) -> Self
Returns configuration with custom group-optimized family of hash functions and cache threshold.
Sourcepub fn with_lsize_ct(
goconf: GOConf<GS, SS, S>,
relative_level_size: u16,
cache_threshold: usize,
) -> Self
pub fn with_lsize_ct( goconf: GOConf<GS, SS, S>, relative_level_size: u16, cache_threshold: usize, ) -> Self
Returns configuration with custom group-optimized family of hash functions, relative level size and cache threshold.
Sourcepub fn with_lsize(goconf: GOConf<GS, SS, S>, relative_level_size: u16) -> Self
pub fn with_lsize(goconf: GOConf<GS, SS, S>, relative_level_size: u16) -> Self
Returns configuration with custom group-optimized family of hash functions and relative level size.
Sourcepub fn with_lsize_mt(
goconf: GOConf<GS, SS, S>,
relative_level_size: u16,
use_multiple_threads: bool,
) -> Self
pub fn with_lsize_mt( goconf: GOConf<GS, SS, S>, relative_level_size: u16, use_multiple_threads: bool, ) -> Self
Returns configuration with custom group-optimized family of hash functions, relative level size and potentially enabled multiple threads.
Sourcepub fn with_mt(goconf: GOConf<GS, SS, S>, use_multiple_threads: bool) -> Self
pub fn with_mt(goconf: GOConf<GS, SS, S>, use_multiple_threads: bool) -> Self
Returns configuration with custom group-optimized family of hash functions, and potentially enabled multiple threads.
Trait Implementations§
Source§impl<GS: Clone + GroupSize, SS: Clone + SeedSize, S: Clone> Clone for GOBuildConf<GS, SS, S>
impl<GS: Clone + GroupSize, SS: Clone + SeedSize, S: Clone> Clone for GOBuildConf<GS, SS, S>
Source§fn clone(&self) -> GOBuildConf<GS, SS, S>
fn clone(&self) -> GOBuildConf<GS, SS, S>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for GOBuildConf
impl Default for GOBuildConf
Auto Trait Implementations§
impl<GS, SS, S> Freeze for GOBuildConf<GS, SS, S>
impl<GS, SS, S> RefUnwindSafe for GOBuildConf<GS, SS, S>
impl<GS, SS, S> Send for GOBuildConf<GS, SS, S>
impl<GS, SS, S> Sync for GOBuildConf<GS, SS, S>
impl<GS, SS, S> Unpin for GOBuildConf<GS, SS, S>
impl<GS, SS, S> UnsafeUnpin for GOBuildConf<GS, SS, S>
impl<GS, SS, S> UnwindSafe for GOBuildConf<GS, SS, S>
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, U> CastableInto<U> for Twhere
U: CastableFrom<T>,
impl<T, U> CastableInto<U> for Twhere
U: CastableFrom<T>,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DowncastableFrom<T> for T
impl<T> DowncastableFrom<T> for T
Source§fn downcast_from(value: T) -> T
fn downcast_from(value: T) -> T
Source§impl<T, U> DowncastableInto<U> for Twhere
U: DowncastableFrom<T>,
impl<T, U> DowncastableInto<U> for Twhere
U: DowncastableFrom<T>,
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