@@ -36,7 +36,20 @@ class LFNBOutputStorage : public OutputStorage<ElementType> {
3636 = sequentialWritePosition % OutputStorage<ElementType>::STORAGE_CAPACITY;
3737 const uint64_t remappedWritePosition
3838 = remap (writePosition) % OutputStorage<ElementType>::STORAGE_CAPACITY;
39-
39+ const uint64_t nextRemappedWritePosition
40+ = remap (writePosition + 1 ) % OutputStorage<ElementType>::STORAGE_CAPACITY;
41+ __builtin_prefetch (
42+ &this ->m_storage [nextRemappedWritePosition],
43+ PrefetchMode::Write,
44+ Locality::High);
45+ __builtin_prefetch (
46+ &this ->m_writersFinished [nextRemappedWritePosition / BUCKET_SIZE],
47+ PrefetchMode::Write,
48+ Locality::High);
49+ __builtin_prefetch (
50+ &this ->m_readersFinished [nextRemappedWritePosition / BUCKET_SIZE],
51+ PrefetchMode::Write,
52+ Locality::High);
4053 BackoffScheme backoffScheme (0 , std::numeric_limits<std::size_t >::max ());
4154 while (m_writersFinished[writePosition / BUCKET_SIZE].load (std::memory_order_acquire)
4255 / BUCKET_SIZE
@@ -67,6 +80,20 @@ class LFNBOutputStorage : public OutputStorage<ElementType> {
6780 = sequentialReadPosition % OutputStorage<ElementType>::STORAGE_CAPACITY;
6881 const uint64_t remappedReadPosition
6982 = remap (readPosition) % OutputStorage<ElementType>::STORAGE_CAPACITY;
83+ const uint64_t nextRemappedReadPosition
84+ = remap (readPosition + 1 ) % OutputStorage<ElementType>::STORAGE_CAPACITY;
85+ __builtin_prefetch (
86+ &this ->m_storage [nextRemappedReadPosition],
87+ PrefetchMode::Write,
88+ Locality::High);
89+ __builtin_prefetch (
90+ &this ->m_writersFinished [nextRemappedReadPosition / BUCKET_SIZE],
91+ PrefetchMode::Write,
92+ Locality::High);
93+ __builtin_prefetch (
94+ &this ->m_readersFinished [nextRemappedReadPosition / BUCKET_SIZE],
95+ PrefetchMode::Write,
96+ Locality::High);
7097 BackoffScheme backoffScheme (0 , std::numeric_limits<std::size_t >::max ());
7198 while ((m_readersFinished[readPosition / BUCKET_SIZE].load (std::memory_order_acquire)
7299 / (BUCKET_SIZE * 1 )
0 commit comments