Releases: alphadose/ZenQ
Releases · alphadose/ZenQ
Add support for specifying queue size
2.6.0 improve perf
Improve performance
2.5.1 improve performance
Improve performance and consistency
2.4.0 improve perf
Improve performance in the case ratio goroutines/cpu_cores is quite large
2.3.0 update benchmarks
Improve selection performance
Improve the performance of select by adding direct_send and optimistic first pass read approach
ZenQ Select() is now comparable to channels although not as fast for large batch sizes
To improve ZenQ's selection performance even beyond this, the goroutine pointer itself has to be mutated for even faster data transfer during selections
With Input Batch Size: 60 and Num Concurrent Writers: 4
Chan Select Runner completed transfer in: 55.375µs
ZenQ Select Runner completed transfer in: 56.125µs
====================================================================
With Input Batch Size: 600 and Num Concurrent Writers: 4
Chan Select Runner completed transfer in: 181.334µs
ZenQ Select Runner completed transfer in: 432.75µs
====================================================================
With Input Batch Size: 6000 and Num Concurrent Writers: 4
Chan Select Runner completed transfer in: 936.042µs
ZenQ Select Runner completed transfer in: 4.410916ms
====================================================================
With Input Batch Size: 600000 and Num Concurrent Writers: 4
Chan Select Runner completed transfer in: 140.836375ms
ZenQ Select Runner completed transfer in: 380.546875ms
====================================================================
Select and Queue Closing Features added
- Selection added, no polling
- Queue closing added, (now every call to Read() will also return whether the queue is currently exhausted or not)
- Performance improved
More resource efficiency in cases of million goroutines
1.5.1 Update versions
New algorithm behaves more consistently
name old time/op new time/op delta
_ZenQ_NumWriters1_InputSize600-8 16.5µs ± 1% 17.9µs ± 1% +8.65% (p=0.000 n=28+29)
_ZenQ_NumWriters3_InputSize60000-8 2.85ms ± 0% 2.67ms ± 6% -6.11% (p=0.000 n=23+30)
_ZenQ_NumWriters8_InputSize6000000-8 417ms ± 0% 313ms ± 5% -24.83% (p=0.000 n=23+29)
_ZenQ_NumWriters100_InputSize6000000-8 741ms ± 3% 516ms ± 2% -30.40% (p=0.000 n=29+30)
_ZenQ_NumWriters1000_InputSize7000000-8 1.05s ± 1% 0.45s ± 9% -57.58% (p=0.000 n=28+30)
_ZenQ_Million_Blocking_Writers-8 7.01s ±44% 10.98s ± 4% +56.54% (p=0.000 n=30+28)
name old alloc/op new alloc/op delta
_ZenQ_NumWriters1_InputSize600-8 0.00B 0.00B ~ (all equal)
_ZenQ_NumWriters3_InputSize60000-8 28.9B ±111% 34.8B ±127% ~ (p=0.268 n=30+29)
_ZenQ_NumWriters8_InputSize6000000-8 885B ±163% 671B ±222% ~ (p=0.208 n=30+30)
_ZenQ_NumWriters100_InputSize6000000-8 16.2kB ±66% 13.3kB ±100% ~ (p=0.072 n=30+30)
_ZenQ_NumWriters1000_InputSize7000000-8 62.4kB ±82% 2.4kB ±210% -96.20% (p=0.000 n=30+30)
_ZenQ_Million_Blocking_Writers-8 95.9MB ± 0% 95.5MB ± 0% -0.41% (p=0.000 n=28+30)
name old allocs/op new allocs/op delta
_ZenQ_NumWriters1_InputSize600-8 0.00 0.00 ~ (all equal)
_ZenQ_NumWriters3_InputSize60000-8 0.00 0.00 ~ (all equal)
_ZenQ_NumWriters8_InputSize6000000-8 2.07 ±142% 1.40 ±186% ~ (p=0.081 n=30+30)
_ZenQ_NumWriters100_InputSize6000000-8 53.5 ±50% 31.8 ±100% -40.60% (p=0.000 n=30+30)
_ZenQ_NumWriters1000_InputSize7000000-8 525 ±39% 6 ±227% -98.95% (p=0.000 n=30+30)
_ZenQ_Million_Blocking_Writers-8 1.00M ± 0% 0.99M ± 0% -0.41% (p=0.000 n=28+29)
Implement select{}
- Add select{} operation
- Added benchmarks for select{} based transfer channels vs zenq
Save resources by parking extra goroutines
In previous version of ZenQ, the tests timed out in cases of a million number of goroutines but this is handled in this version by parking extra goroutines
name old time/op new time/op delta
_Chan_NumWriters1_InputSize600-8 23.2µs ± 0% 24.2µs ± 0% ~ (p=1.000 n=1+1)
_ZenQ_NumWriters1_InputSize600-8 16.3µs ± 0% 16.7µs ± 0% ~ (p=1.000 n=1+1)
_Chan_NumWriters3_InputSize60000-8 5.55ms ± 0% 6.19ms ± 0% ~ (p=1.000 n=1+1)
_ZenQ_NumWriters3_InputSize60000-8 2.80ms ± 0% 2.85ms ± 0% ~ (p=1.000 n=1+1)
_Chan_NumWriters8_InputSize6000000-8 694ms ± 0% 730ms ± 0% ~ (p=1.000 n=1+1)
_ZenQ_NumWriters8_InputSize6000000-8 446ms ± 0% 421ms ± 0% ~ (p=1.000 n=1+1)
_Chan_NumWriters100_InputSize6000000-8 1.59s ± 0% 1.60s ± 0% ~ (p=1.000 n=1+1)
_ZenQ_NumWriters100_InputSize6000000-8 490ms ± 0% 736ms ± 0% ~ (p=1.000 n=1+1)
_Chan_NumWriters1000_InputSize7000000-8 1.97s ± 0% 1.97s ± 0% ~ (p=1.000 n=1+1)
_ZenQ_NumWriters1000_InputSize7000000-8 769ms ± 0% 1052ms ± 0% ~ (p=1.000 n=1+1)
name old alloc/op new alloc/op delta
_Chan_NumWriters1_InputSize600-8 0.00B 0.00B ~ (all equal)
_ZenQ_NumWriters1_InputSize600-8 0.00B 0.00B ~ (all equal)
_Chan_NumWriters3_InputSize60000-8 63.0B ± 0% 96.0B ± 0% ~ (p=1.000 n=1+1)
_ZenQ_NumWriters3_InputSize60000-8 44.0B ± 0% 0.0B ~ (p=1.000 n=1+1)
_Chan_NumWriters8_InputSize6000000-8 1.76kB ± 0% 0.24kB ± 0% ~ (p=1.000 n=1+1)
_ZenQ_NumWriters8_InputSize6000000-8 1.52kB ± 0% 0.31kB ± 0% ~ (p=1.000 n=1+1)
_Chan_NumWriters100_InputSize6000000-8 51.2kB ± 0% 35.9kB ± 0% ~ (p=1.000 n=1+1)
_ZenQ_NumWriters100_InputSize6000000-8 5.27kB ± 0% 18.94kB ± 0% ~ (p=1.000 n=1+1)
_Chan_NumWriters1000_InputSize7000000-8 492kB ± 0% 492kB ± 0% ~ (p=1.000 n=1+1)
_ZenQ_NumWriters1000_InputSize7000000-8 16.6kB ± 0% 34.3kB ± 0% ~ (p=1.000 n=1+1)
name old allocs/op new allocs/op delta
_Chan_NumWriters1_InputSize600-8 0.00 0.00 ~ (all equal)
_ZenQ_NumWriters1_InputSize600-8 0.00 0.00 ~ (all equal)
_Chan_NumWriters3_InputSize60000-8 0.00 0.00 ~ (all equal)
_ZenQ_NumWriters3_InputSize60000-8 0.00 0.00 ~ (all equal)
_Chan_NumWriters8_InputSize6000000-8 5.00 ± 0% 2.00 ± 0% ~ (p=1.000 n=1+1)
_ZenQ_NumWriters8_InputSize6000000-8 3.00 ± 0% 1.00 ± 0% ~ (p=1.000 n=1+1)
_Chan_NumWriters100_InputSize6000000-8 163 ± 0% 147 ± 0% ~ (p=1.000 n=1+1)
_ZenQ_NumWriters100_InputSize6000000-8 12.0 ± 0% 49.0 ± 0% ~ (p=1.000 n=1+1)
_Chan_NumWriters1000_InputSize7000000-8 1.81k ± 0% 1.77k ± 0% ~ (p=1.000 n=1+1)
_ZenQ_NumWriters1000_InputSize7000000-8 40.0 ± 0% 357.0 ± 0% ~ (p=1.000 n=1+1)