What
lockfree_spsc_queue in src/impl/async/lockfree_queue.h:191 declares a separate alignas(cache_line_size) std::array<std::atomic<size_t>, Size> sequence_ array. However, each cell struct (L:157) already contains its own std::atomic<size_t> sequence field. The standalone sequence_ array is initialized but never referenced in enqueue/dequeue operations.
Why
- With default
Size = 1024, the unused array wastes ~8KB of memory
- The array also increases cache footprint, potentially evicting useful data from L1/L2 cache
Where
src/impl/async/lockfree_queue.h:191 — unused sequence_ array declaration
src/impl/async/lockfree_queue.h:157 — cell::sequence already provides per-slot sequencing
How
Acceptance Criteria
What
lockfree_spsc_queueinsrc/impl/async/lockfree_queue.h:191declares a separatealignas(cache_line_size) std::array<std::atomic<size_t>, Size> sequence_array. However, eachcellstruct (L:157) already contains its ownstd::atomic<size_t> sequencefield. The standalonesequence_array is initialized but never referenced in enqueue/dequeue operations.Why
Size = 1024, the unused array wastes ~8KB of memoryWhere
src/impl/async/lockfree_queue.h:191— unusedsequence_array declarationsrc/impl/async/lockfree_queue.h:157—cell::sequencealready provides per-slot sequencingHow
Acceptance Criteria
sequence_array removedcell::sequenceexclusively