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>

source

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.

source

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.

source

pub fn new(goconf: GOConf<GS, SS, S>) -> Self

Returns configuration with custom group-optimized family of hash functions.

source

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.

source

pub fn with_lsize_ct( goconf: GOConf<GS, SS, S>, relative_level_size: u16, cache_threshold: usize ) -> Self

source

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.

source

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.

source

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>

source§

fn clone(&self) -> GOBuildConf<GS, SS, S>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for GOBuildConf

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<GS: GroupSize + Sync, SS: SeedSize, S: BuildSeededHasher + Sync> From<GOConf<GS, SS, S>> for GOBuildConf<GS, SS, S>

source§

fn from(value: GOConf<GS, SS, S>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<GS, SS, S> RefUnwindSafe for GOBuildConf<GS, SS, S>

§

impl<GS, SS, S> Send for GOBuildConf<GS, SS, S>
where GS: Send, S: Send, SS: Send,

§

impl<GS, SS, S> Sync for GOBuildConf<GS, SS, S>
where GS: Sync, S: Sync,

§

impl<GS, SS, S> Unpin for GOBuildConf<GS, SS, S>
where GS: Unpin, S: Unpin, SS: Unpin,

§

impl<GS, SS, S> UnwindSafe for GOBuildConf<GS, SS, S>
where GS: UnwindSafe, S: UnwindSafe, SS: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.