pub struct HnswMemoryStats {
pub live_nodes: usize,
pub neighbour_slots: usize,
pub back_ref_entries: usize,
pub vector_floats: usize,
}Expand description
What an HnswIndex is holding, in countable units rather than bytes.
Produced by HnswIndex::memory_stats. Payload only: see that method for
what is deliberately not counted.
Fields§
§live_nodes: usizeVectors currently indexed.
neighbour_slots: usizeTotal neighbour entries across every live node’s every layer.
back_ref_entries: usizeTotal entries in the reverse adjacency index.
vector_floats: usizeTotal floats stored across every live node’s vector. f32s since 0.6.6:
the index’s own copy is the slab’s, and the f64s stay in the store.
Implementations§
Source§impl HnswMemoryStats
impl HnswMemoryStats
Sourcepub fn bytes_per_node(&self) -> f64
pub fn bytes_per_node(&self) -> f64
Payload bytes per indexed vector: adjacency (4 B per entry, forward and
reverse) plus the index’s own copy of the vector (4 B per dimension — the
store’s f64 copy is not the index’s business). Zero for an empty index.
Sourcepub fn adjacency_bytes_per_node(&self) -> f64
pub fn adjacency_bytes_per_node(&self) -> f64
The adjacency half of Self::bytes_per_node — the half the index
shape controls. The vector half is fixed by the embedding’s dimension.
Trait Implementations§
Source§impl Clone for HnswMemoryStats
impl Clone for HnswMemoryStats
Source§fn clone(&self) -> HnswMemoryStats
fn clone(&self) -> HnswMemoryStats
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for HnswMemoryStats
Source§impl Debug for HnswMemoryStats
impl Debug for HnswMemoryStats
Source§impl Default for HnswMemoryStats
impl Default for HnswMemoryStats
Source§fn default() -> HnswMemoryStats
fn default() -> HnswMemoryStats
impl Eq for HnswMemoryStats
Source§impl PartialEq for HnswMemoryStats
impl PartialEq for HnswMemoryStats
impl StructuralPartialEq for HnswMemoryStats
Auto Trait Implementations§
impl Freeze for HnswMemoryStats
impl RefUnwindSafe for HnswMemoryStats
impl Send for HnswMemoryStats
impl Sync for HnswMemoryStats
impl Unpin for HnswMemoryStats
impl UnsafeUnpin for HnswMemoryStats
impl UnwindSafe for HnswMemoryStats
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.