Struct ph::fmph::GOBuildConf
source · 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: usize
The 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: u16
Size 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: bool
Whether 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 = 134_217_728usize
pub const DEFAULT_CACHE_THRESHOLD: usize = 134_217_728usize
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 more