mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-09-02 17:15:43 +00:00
Fix clippy
This commit is contained in:
@@ -7,14 +7,11 @@
|
|||||||
//! - `single_thread_write`: per-`add` cost with no contention (floor cost).
|
//! - `single_thread_write`: per-`add` cost with no contention (floor cost).
|
||||||
//! - `read_cost` : per-`get()` cost.
|
//! - `read_cost` : per-`get()` cost.
|
||||||
//! - `counter_handle` : the REAL production hot path. Measures the actual
|
//! - `counter_handle` : the REAL production hot path. Measures the actual
|
||||||
//! `stats_manager::CounterHandle::add` (sharded `fetch_add` + lock-free
|
//! `stats_manager::CounterHandle::add` (single-atomic `fetch_add` + lock-free
|
||||||
//! atomic-millis `touch`) against reconstructed baselines:
|
//! fastant `touch`) against reconstructed baselines:
|
||||||
//! * `prod` - real `CounterHandle` (this code's version)
|
//! * `prod` - real `CounterHandle` (this code's version)
|
||||||
//! * `baseline_cas_mutex` - pre-optimization design: single
|
//! * `baseline_cas_mutex` - pre-optimization: single `AtomicU64` with `fetch_update` (CAS) + `Mutex<Instant>` touch
|
||||||
//! `AtomicU64` with `fetch_update` (CAS) +
|
//! * `baseline_fetchadd_mutex` - `fetch_add` + `Mutex<Instant>` touch (isolates the lock-free fastant touch)
|
||||||
//! `Mutex<Instant>` touch
|
|
||||||
//! * `baseline_fetchadd_mutex`- `fetch_add` + `Mutex<Instant>` touch
|
|
||||||
//! (isolates the sharding + lock-free touch)
|
|
||||||
//!
|
//!
|
||||||
//! Run: `cargo bench -p easytier --bench counter_contention`
|
//! Run: `cargo bench -p easytier --bench counter_contention`
|
||||||
|
|
||||||
@@ -153,7 +150,7 @@ impl Counter for ShardedAtomic {
|
|||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
thread_local! {
|
thread_local! {
|
||||||
static TLS_DELTA: Cell<u64> = Cell::new(0);
|
static TLS_DELTA: Cell<u64> = const { Cell::new(0) };
|
||||||
}
|
}
|
||||||
|
|
||||||
struct ThreadLocalCell {
|
struct ThreadLocalCell {
|
||||||
|
|||||||
Reference in New Issue
Block a user