pub struct SimdBatchProcessor { /* private fields */ }Expand description
SIMD batch processor for key operations.
Uses SIMD instructions where available to process multiple keys in parallel within a single thread.
Implementations§
Source§impl SimdBatchProcessor
impl SimdBatchProcessor
Sourcepub fn optimal_batch_size() -> usize
pub fn optimal_batch_size() -> usize
Get the optimal batch size for the current platform.
This is based on SIMD register width:
- AVX-512: 512 bits = 64 bytes = 2 keys
- AVX2: 256 bits = 32 bytes = 1 key
- SSE: 128 bits = 16 bytes = 0.5 keys
We use multiples for better throughput.
Sourcepub fn is_available() -> bool
pub fn is_available() -> bool
Check if SIMD is available on this platform.
Sourcepub fn feature_name() -> &'static str
pub fn feature_name() -> &'static str
Get SIMD feature name for current platform.
Sourcepub fn with_batch_size(self, size: usize) -> Self
pub fn with_batch_size(self, size: usize) -> Self
Set the batch size.
Sourcepub fn process_batch<F>(&self, count: usize, processor: F) -> Vec<PrivateKey>where
F: FnMut(&PrivateKey),
pub fn process_batch<F>(&self, count: usize, processor: F) -> Vec<PrivateKey>where
F: FnMut(&PrivateKey),
Process keys in SIMD-optimized batches.
This method generates keys and applies a function to each, using SIMD-friendly memory access patterns.
Sourcepub fn keys_to_hex(&self, keys: &[PrivateKey]) -> Vec<String>
pub fn keys_to_hex(&self, keys: &[PrivateKey]) -> Vec<String>
Convert keys to hex strings using SIMD-optimized conversion.
Sourcepub fn parallel_generate(&self, count: usize) -> Vec<PrivateKey>
pub fn parallel_generate(&self, count: usize) -> Vec<PrivateKey>
Parallel SIMD batch generation.
Combines SIMD optimization with multi-threading for maximum throughput.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SimdBatchProcessor
impl RefUnwindSafe for SimdBatchProcessor
impl Send for SimdBatchProcessor
impl Sync for SimdBatchProcessor
impl Unpin for SimdBatchProcessor
impl UnwindSafe for SimdBatchProcessor
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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