• Stars
    star
    652
  • Rank 68,620 (Top 2 %)
  • Language
    Go
  • License
    MIT License
  • Created almost 6 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Golang implementation of Hierarchical Timing Wheels.

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

More Repositories

1

slidingwindow

Golang implementation of Sliding Window Algorithm for distributed rate limiting.
Go
386
star
2

validating

A Go library for validating structs, maps and slices.
Go
221
star
3

caddy-ext

Various Caddy v2 extensions (a.k.a. modules).
Go
93
star
4

kun

A communication toolkit for Go services.
Go
89
star
5

pdfbookmarker

Add bookmarks into PDF using PyPDF2
Python
80
star
6

protoc-go-plugins

Some useful Go's protoc plugins.
Go
57
star
7

forum

a simple forum based on web.py
Python
40
star
8

goodtimer

Golang timer for humans.
Go
39
star
9

grpc-pytools

Some useful Python's gRPC tools.
Python
28
star
10

micron

A minimal implementation of the fault-tolerant job scheduler.
Go
22
star
11

rpubsub

Reliable implementation of Publish–subscribe messaging pattern backed by Redis Streams.
Go
20
star
12

caddy-mesh

Caddy service mesh based on the host/node architecture.
Go
20
star
13

ratelimiter

A distributed token-bucket rate limiter backed by Redis.
Go
19
star
14

dbtest

Database testing made easy in Go.
Go
18
star
15

resource

A Python library concentrated on the Resource layer of RESTful APIs.
Python
18
star
16

superdiscoverer

A Supervisor backed service discoverer for automatic service-discovery.
Go
15
star
17

structool

A codec for Go structs with support for chainable encoding/decoding hooks.
Go
12
star
18

hats

Communicating with NATS using the HTTP protocol.
Go
12
star
19

pyprof-timer

A timer for profiling a Python function or snippet.
Python
8
star
20

crest

A simple REST client for Python.
Python
8
star
21

fieldmask

Partial reads and updates made easy for REST APIs in Go.
Go
6
star
22

easyconfig

A simple library for loading configurations easily in Python, inspired by `flask.config`.
Python
5
star
23

pymwa

MetaWeblog API (MWA) implemented in Python
Python
4
star
24

appx

An application framework that makes it easy to build pluggable and reusable applications.
Go
3
star
25

PiL3-notes

《Lua 程序设计 3》的读书笔记
3
star
26

gopt

Generic Functional Options for Go.
Go
3
star
27

pyawk

A simple variant of AWK in Python.
Python
2
star
28

orchestrator

A Go library for service orchestration.
Go
2
star
29

olaf

Configuration Manager for Caddy.
Go
2
star
30

miniweb

miniweb is a minimal web framework for Python, inspired by web.py.
Python
2
star
31

workitem

A specific audit-system with MVC-like architecture, and it's demo.
Python
1
star
32

cooly

A utility that helps you deploy Python projects.
Python
1
star
33

jsonsir

A serializer for JSON-like data in Python.
Python
1
star
34

gotask

The minimal Go library for implementing an asynchronous task worker.
Go
1
star
35

chatinhttp

Chat in HTTP between client and server.
Python
1
star
36

goku

Go
1
star
37

jsonform

Form validation for JSON-like data (i.e. document) in Python.
Python
1
star
38

vext

Extension validator factories for validating.
Go
1
star
39

gosignal

A Golang library for in-process signal dispatching.
Go
1
star