Skip to content

Commit

Permalink
Merge pull request #309 from wang384670111/tune_ordering
Browse files Browse the repository at this point in the history
Fine-tune the Ordering for changed_blocks_count
  • Loading branch information
rpkelly authored Feb 26, 2024
2 parents cb8dc0f + aa9133e commit b61c570
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/upload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ impl SnapshotUploader {
.fail()?;
}

let changed_blocks_count = changed_blocks_count.load(AtomicOrdering::SeqCst);
let changed_blocks_count = changed_blocks_count.load(AtomicOrdering::Relaxed);

// Compute the "linear" hash - the hash of all hashes in block index order.
let block_digests = Arc::try_unwrap(block_digests)
Expand Down Expand Up @@ -397,7 +397,7 @@ impl SnapshotUploader {
block_digests.insert(block_index, hash_bytes.to_vec());

let changed_blocks_count = &context.changed_blocks_count;
changed_blocks_count.fetch_add(1, AtomicOrdering::SeqCst);
changed_blocks_count.fetch_add(1, AtomicOrdering::Relaxed);

if let Some(ref progress_bar) = *context.progress_bar {
progress_bar.inc(1);
Expand Down

0 comments on commit b61c570

Please sign in to comment.