pub struct SimdTripleMatcher { /* private fields */ }Expand description
SIMD-optimized triple matcher with full SciRS2-core integration
Uses CPU vector instructions and SciRS2-core’s advanced array operations to match multiple triples against patterns simultaneously. This provides significant speedup for large-scale pattern matching operations in SPARQL query evaluation.
Features:
- Array-based SIMD operations with SciRS2-core
- Parallel processing for large batches (with “parallel” feature)
- Built-in performance metrics tracking
- Platform-adaptive (AVX2/AVX-512/NEON via scirs2-core)
Implementations§
Source§impl SimdTripleMatcher
impl SimdTripleMatcher
Sourcepub fn with_chunk_size(chunk_size: usize) -> Self
pub fn with_chunk_size(chunk_size: usize) -> Self
Create a matcher with custom chunk size
Sourcepub fn stats(&self) -> MatcherStats
pub fn stats(&self) -> MatcherStats
Get performance statistics for this matcher
Sourcepub fn reset_stats(&self)
pub fn reset_stats(&self)
Reset all performance statistics
Note: Resetting metrics is not supported by scirs2-core’s Counter and Timer, so we only reset the atomic counters. Create a new matcher for fresh stats.
Sourcepub fn match_batch(
&self,
pattern: &TriplePattern,
triples: &[Triple],
) -> Result<Vec<usize>>
pub fn match_batch( &self, pattern: &TriplePattern, triples: &[Triple], ) -> Result<Vec<usize>>
Match a batch of triples against a pattern using SIMD
This is the primary entry point for SIMD-optimized pattern matching. It processes triples in chunks using SIMD operations for maximum throughput.
§Arguments
pattern- The triple pattern to match againsttriples- The triples to check for matches
§Returns
A vector of indices indicating which triples matched the pattern
Sourcepub fn estimate_selectivity(
&self,
pattern: &TriplePattern,
_total_triples: usize,
) -> f32
pub fn estimate_selectivity( &self, pattern: &TriplePattern, _total_triples: usize, ) -> f32
Estimate selectivity of a pattern for query optimization
Returns a value between 0.0 (no matches) and 1.0 (all match)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SimdTripleMatcher
impl RefUnwindSafe for SimdTripleMatcher
impl Send for SimdTripleMatcher
impl Sync for SimdTripleMatcher
impl Unpin for SimdTripleMatcher
impl UnsafeUnpin for SimdTripleMatcher
impl UnwindSafe for SimdTripleMatcher
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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