summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2022-09-09 11:54:53 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2022-09-09 11:54:53 +0000
commit86a9935359d3669f821060eda4fbb40f22f0824e (patch)
tree65ea82c90530e7583b05a38cb82d8f713fb08269 /searchcore
parent9f6fb069ec73285b1d60f67c0ee2408f9b3e204b (diff)
Use cheaper load/store instead of fetch_add/fetch_sub
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/vespa/searchcore/proton/bucketdb/bucketdb.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/bucketdb/bucketdb.h b/searchcore/src/vespa/searchcore/proton/bucketdb/bucketdb.h
index 3a81203a21f..d0d4b14af9e 100644
--- a/searchcore/src/vespa/searchcore/proton/bucketdb/bucketdb.h
+++ b/searchcore/src/vespa/searchcore/proton/bucketdb/bucketdb.h
@@ -32,10 +32,10 @@ private:
size_t countActiveDocs() const;
void checkActiveCount() const;
void addActive(size_t value) {
- _numActiveDocs.fetch_add(value, std::memory_order_relaxed);
+ _numActiveDocs.store(getNumActiveDocs() + value, std::memory_order_relaxed);
}
void subActive(size_t value) {
- _numActiveDocs.fetch_sub(value, std::memory_order_relaxed);
+ _numActiveDocs.store(getNumActiveDocs() - value, std::memory_order_relaxed);
}
public:
BucketDB();