https://github.com/advantageous/go-qbit
GoLang QBit, just the queue
https://github.com/advantageous/go-qbit
Last synced: 6 months ago
JSON representation
GoLang QBit, just the queue
- Host: GitHub
- URL: https://github.com/advantageous/go-qbit
- Owner: advantageous
- License: apache-2.0
- Created: 2016-12-13T19:02:56.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-12-15T21:07:24.000Z (about 9 years ago)
- Last Synced: 2025-04-06T14:36:22.489Z (9 months ago)
- Language: Go
- Size: 385 KB
- Stars: 7
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-qbit
GoLang QBit, just the queue!
Reduces thread synchronization and locking by sending messages in batches.
Implements auto-flushing of batches.
QBit queue is over 7.2 to 7.5 times faster than golang's internal channel.
You also get notification via callbacks when the queue is empty, a new batch started,
or a new batch ended (and more).
#### QBit queue
```sh
go test -v github.com/advantageous/go-qbit/qbit -bench ^BenchmarkQueue$ -run ^$
1 13982813803 ns/op
PASS
ok github.com/advantageous/go-qbit/qbit 13.992s
```
QBit with a single reader and a single writer was able to send
71,469,411 messages a second.
#### Go Channel
```sh
go test -v github.com/advantageous/go-qbit/qbit -bench ^BenchmarkChannel$ -run ^$
1 104966302989 ns/op
PASS
ok github.com/advantageous/go-qbit/qbit 104.980s
```
Golang channel with a single reader and a single writer was able to send
9,525,623 messages a second.
#### Improvement
Use pooling. Created simpler queue manager.
#### Queue Pooling off (2 seconds faster than before with simpler queue manager)
```
heap 2,437,776 GC count 4,531
1 12666113306 ns/op
PASS
ok github.com/advantageous/go-qbit/qbit 12.676s
```
#### Queue Pooling on (3 seconds faster than before with simpler queue manager)
```
heap 2,505,232 GC count 3
1 10912673726 ns/op
PASS
ok github.com/advantageous/go-qbit/qbit 10.924s
```
GC collections went from 4,531 to 3.
