A thread-safe queue faster and more resource efficient than golang's native channels
MIT License
Published by alphadose over 2 years ago
By changing the spinning lastCommittedIndex to slot based CAS operations, we gain a lot of performance as compared to channels for the following tested cases:-
Benchmark_Chan_NumWriters1000_InputSize7000000-8 1 1984590667 ns/op 497344 B/op 1817 allocs/op
Benchmark_ZenQ_NumWriters1000_InputSize7000000-8 2 777197480 ns/op 8736 B/op 21 allocs/op