Skip to content

Commit 0925e26

Browse files
Zainullin DamirZainullin Damir
authored andcommitted
++
1 parent 7f7acad commit 0925e26

3 files changed

Lines changed: 9 additions & 92 deletions

File tree

include/ipfixprobe/outputPlugin/outputStorage/bucketAllocator.hpp

Lines changed: 0 additions & 85 deletions
This file was deleted.

include/ipfixprobe/outputPlugin/outputStorage/cacheAlligned.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ class CacheAlligned {
1010
public:
1111
template<typename... Args>
1212
explicit CacheAlligned(Args&&... args) noexcept
13-
: data(std::forward<Args>(args)...)
13+
: m_data(std::forward<Args>(args)...)
1414
{
1515
}
1616

1717
CacheAlligned<Type>& operator=(const Type& other) noexcept
1818
{
19-
data = other;
19+
m_data = other;
2020
return *this;
2121
}
2222

23-
constexpr auto& get(this auto& self) noexcept { return self.data; }
23+
constexpr auto& get(this auto& self) noexcept { return self.m_data; }
2424

25-
constexpr auto operator->(this auto& self) noexcept { return &self.data; }
25+
constexpr auto operator->(this auto& self) noexcept { return &self.m_data; }
2626

2727
private:
2828
#pragma GCC diagnostic push
@@ -33,7 +33,7 @@ class CacheAlligned {
3333
static constexpr std::size_t PADDING_SIZE
3434
= (sizeof(Type) < EXPECTED_CACHE_LINE_SIZE) ? (EXPECTED_CACHE_LINE_SIZE - sizeof(Type)) : 0;
3535

36-
alignas(EXPECTED_CACHE_LINE_SIZE) Type data;
36+
alignas(EXPECTED_CACHE_LINE_SIZE) Type m_data;
3737
const std::array<std::byte, PADDING_SIZE> m_padding {};
3838
};
3939

include/ipfixprobe/outputPlugin/outputStorage/ffq2OutputStorage.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ namespace ipxp::output {
77

88
template<typename ElementType>
99
class FFQ2OutputStorage : public FFQOutputStorage<ElementType> {
10-
constexpr static uint32_t SHORT_TRIES = 5;
11-
constexpr static uint32_t LONG_TRIES = 3;
10+
// constexpr static uint32_t SHORT_TRIES = 5;
11+
// constexpr static uint32_t LONG_TRIES = 3;
1212

1313
public:
1414
explicit FFQ2OutputStorage(
@@ -30,6 +30,7 @@ class FFQ2OutputStorage : public FFQOutputStorage<ElementType> {
3030
BackoffScheme backoffScheme(70, std::numeric_limits<std::size_t>::max());
3131
const uint64_t writeRank = this->m_writeRank->fetch_add(1, std::memory_order_acq_rel);
3232
const uint64_t writeIndex = remap(writeRank) % OutputStorage<ElementType>::STORAGE_CAPACITY;
33+
__builtin_prefetch(&this->m_cells[writeIndex + 1], PrefetchMode::Write, Locality::High);
3334
while (!this->m_cells[writeIndex].state.tryToSetWriter()) {
3435
backoffScheme.backoff();
3536
}
@@ -52,6 +53,7 @@ class FFQ2OutputStorage : public FFQOutputStorage<ElementType> {
5253
}
5354
const uint64_t readRank = this->m_readRank->fetch_add(1, std::memory_order_acq_rel);
5455
const uint64_t readIndex = remap(readRank) % OutputStorage<ElementType>::STORAGE_CAPACITY;
56+
__builtin_prefetch(&this->m_cells[readIndex + 1], PrefetchMode::Write, Locality::High);
5557
while (readRank >= this->m_writeRank->load(std::memory_order_acquire)
5658
&& this->writersPresent()) {
5759
backoffScheme.backoff();

0 commit comments

Comments
 (0)