bicache-example

command
v2.0.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2018 License: MIT Imports: 6 Imported by: 0

README

Excerpts:

c, _ := bicache.New(&bicache.Config{
	MFUSize:   50000,
	MRUSize:   25000,
	AutoEvict: 1000,
})

for i := 0; i < 50000; i++ {
	start := time.Now()
	c.Set(i, i*2)
}

for i := 0; i < 50000; i++ {
	_ = c.Get(i)
	t.AddTime(time.Since(start))
}

Running:

% bicache-example
[ Set 100000 keys ]
100000 samples of 100000 events
Cumulative:     21.523946ms
Avg.:           215ns
p50:            191ns
p75:            215ns
p95:            359ns
p99:            495ns
p999:           2.811µs
Long 5%:        695ns
Short 5%:       137ns
Max:            49.386µs
Min:            121ns
Rate/sec.:      4645988.24

[ Get 100000 keys ]
100000 samples of 100000 events
Cumulative:	19.242196ms
Avg.:		192ns
p50: 		182ns
p75:		219ns
p95:		311ns
p99:		446ns
p999:		589ns
Long 5%:	481ns
Short 5%:	100ns
Max:		281.841µs
Min:		82ns
Rate/sec.:	5196912.04

{"MFUSize":0,"MRUSize":100000,"MFUUsedP":0,"MRUUsedP":200,"Hits":100010,"Misses":0,"Evictions":0}

Note: timing data via tachymeter

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL