Skip to content
Golang implementation of Hierarchical Timing Wheels.
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
delayqueue Make delayqueue as a standalone package May 18, 2019
README.md Again correct benchmark tests Oct 14, 2018
bucket.go Make all internal types unexported Oct 11, 2018
timingwheel.go
timingwheel_benchmark_test.go Again correct benchmark tests Oct 14, 2018
timingwheel_examples_test.go Tweaks Oct 11, 2018
timingwheel_test.go Tweaks Oct 11, 2018
utils.go Make all internal types unexported Oct 11, 2018

README.md

timingwheel

Golang implementation of Hierarchical Timing Wheels.

Installation

$ go get -u github.com/RussellLuo/timingwheel

Design

timingwheel is ported from Kafka's purgatory, which is designed based on Hierarchical Timing Wheels.

中文博客:层级时间轮的 Golang 实现

Documentation

For usage and examples see the Godoc.

Benchmark

$ go test -bench=. -benchmem
goos: darwin
goarch: amd64
pkg: github.com/RussellLuo/timingwheel
BenchmarkTimingWheel_StartStop/N-1m-8            5000000               329 ns/op              83 B/op          2 allocs/op
BenchmarkTimingWheel_StartStop/N-5m-8            5000000               363 ns/op              95 B/op          2 allocs/op
BenchmarkTimingWheel_StartStop/N-10m-8           5000000               440 ns/op              37 B/op          1 allocs/op
BenchmarkStandardTimer_StartStop/N-1m-8         10000000               199 ns/op              64 B/op          1 allocs/op
BenchmarkStandardTimer_StartStop/N-5m-8          2000000               644 ns/op              64 B/op          1 allocs/op
BenchmarkStandardTimer_StartStop/N-10m-8          500000              2434 ns/op              64 B/op          1 allocs/op
PASS
ok      github.com/RussellLuo/timingwheel       116.977s

License

MIT

You can’t perform that action at this time.