Skip to content

Releases: alphadose/ZenQ

Drop-in replacement for channels

02 May 14:55
Compare
Choose a tag to compare

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:-

  1. Single Producer Single Consumer (gain of around 94 seconds with input size 6 * 108)
  2. Multi Producer Single Consumer where NUM_WRITER_GOROUTINES < NUM_CPU_CORES
  3. Multi Producer Single Consumer where NUM_WRITER_GOROUTINES > NUM_CPU_CORES as illustrated below
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