pub enum TransactionMode {
ReadOnly,
WriteOnly,
ReadWrite,
}Expand description
Transaction mode for SSI optimization
By classifying transactions at begin time, we can skip expensive SSI tracking for the majority of transactions:
| Mode | SSI Read Tracking | SSI Write Tracking | Commit Overhead |
|---|---|---|---|
| ReadOnly | None | None | ~10 ns |
| WriteOnly | None | Full | ~30 ns |
| ReadWrite | Full | Full | ~50 ns |
§Performance Analysis
For read-only transactions (typically 90% of workload):
Current: T_txn = T_begin + N × (T_read + T_record) + T_commit
= 100ns + N × (32ns + 50ns) + 50ns = 150ns + 82ns × N
ReadOnly: T_txn = T_begin_ro + N × T_read + T_commit_ro
= 20ns + N × 32ns + 10ns = 30ns + 32ns × N
For N=100 reads: 8350ns → 3230ns (2.6× faster)Variants§
ReadOnly
Read-only transaction - skips ALL SSI tracking Cannot form rw-antidependency cycles (no writes to create outgoing edges) Safe to skip read_set, read_bloom, and commit validation entirely
WriteOnly
Write-only transaction - skips read tracking Cannot form incoming rw-edges (no reads from concurrent writers) Only needs write_set and write_bloom tracking
ReadWrite
Full read-write transaction (default) - complete SSI tracking May form both incoming and outgoing rw-edges Requires full validation at commit time
Implementations§
Source§impl TransactionMode
impl TransactionMode
Sourcepub fn tracks_reads(&self) -> bool
pub fn tracks_reads(&self) -> bool
Check if this mode requires read tracking
Sourcepub fn tracks_writes(&self) -> bool
pub fn tracks_writes(&self) -> bool
Check if this mode requires write tracking
Sourcepub fn needs_ssi_validation(&self) -> bool
pub fn needs_ssi_validation(&self) -> bool
Check if commit needs SSI validation
Trait Implementations§
Source§impl Clone for TransactionMode
impl Clone for TransactionMode
Source§fn clone(&self) -> TransactionMode
fn clone(&self) -> TransactionMode
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 TransactionMode
Source§impl Debug for TransactionMode
impl Debug for TransactionMode
Source§impl Default for TransactionMode
impl Default for TransactionMode
Source§fn default() -> TransactionMode
fn default() -> TransactionMode
impl Eq for TransactionMode
Source§impl PartialEq for TransactionMode
impl PartialEq for TransactionMode
Source§fn eq(&self, other: &TransactionMode) -> bool
fn eq(&self, other: &TransactionMode) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for TransactionMode
Auto Trait Implementations§
impl Freeze for TransactionMode
impl RefUnwindSafe for TransactionMode
impl Send for TransactionMode
impl Sync for TransactionMode
impl Unpin for TransactionMode
impl UnsafeUnpin for TransactionMode
impl UnwindSafe for TransactionMode
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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