We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 248a7b7 commit 25ae1c5Copy full SHA for 25ae1c5
src/common/ttl_map.rs
@@ -368,7 +368,6 @@ mod tests {
368
369
let start_time = Instant::now();
370
let task_count = 100_000;
371
- let contention_factor = 10;
372
373
// Spawn 10 tasks that repeatedly read the same keys
374
let mut handles = Vec::new();
@@ -377,7 +376,7 @@ mod tests {
377
376
let handle = tokio::spawn(async move {
378
// All tasks fight for the same keys - maximum contention
379
let start = Instant::now();
380
- let _value = map.get_or_init(task_id % (task_count / contention_factor), || task_id * 1000).await;
+ let _value = map.get_or_init(rand::random(), || task_id * 1000).await;
381
start.elapsed().as_nanos()
382
});
383
handles.push(handle);
0 commit comments