gocache

package module
v0.0.0-...-56d5996 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2022 License: MIT Imports: 10 Imported by: 0

README

Simple performance comparison of cache libraries written in golang.

Reports

bigcache cachego ecache freecache gcache gocache
PutInt :airplane: :rocket: :rocket: :airplane: :airplane:
GetInt :airplane: :airplane: :rocket: :airplane: :airplane:
Put1K :airplane: :airplane: :rocket: :rocket: :rocket: :airplane:
Put1M :snail: :rocket: :snail: :airplane: :airplane:
PutTinyObject :airplane: :rocket: :rocket: :airplane:
ChangeOutAllInt :airplane: :rocket: :rocket: :airplane: :airplane:
HeavyReadInt :rocket: :rocket: :rocket: :rocket:
HeavyReadIntGC :airplane: :rocket: :rocket: :airplane: :airplane:
HeavyWriteInt :rocket: :airplane: :rocket: :rocket: :airplane:
HeavyWriteIntGC :rocket: :airplane: :airplane:
HeavyWrite1K :snail: :airplane: :rocket: :rocket: :airplane:
HeavyWrite1KGC :snail: :airplane: :rocket: :rocket: :airplane:
HeavyMixedInt :rocket: :airplane: :rocket: :airplane: :rocket:

🐌 for very-slow, ✈ for fast, 🚀 for very-fast.

Default parameters

  • 256 shards * 32 items, 10s expiration

  • gcache is 256 shards as default

  • set value as key+1 when int cases

Misc

  • create a issue to add new libraries

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Data1K = randomString(1024)
View Source
var Data1M = randomString(1048576)

Functions

func AddGCPause

func AddGCPause()

func AddMem

func AddMem()

func AddRate

func AddRate(r float64)

func D

func D(d int64) []byte

func GCPause

func GCPause() time.Duration

func Int64Key

func Int64Key(d int64) string

func PrintGCPause

func PrintGCPause()

func PrintMem

func PrintMem()

func PrintRate

func PrintRate()

Types

type UserInfo

type UserInfo struct {
	Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Age                  int32    `protobuf:"varint,2,opt,name=age,proto3" json:"age,omitempty"`
	Gender               int32    `protobuf:"varint,3,opt,name=gender,proto3" json:"gender,omitempty"`
	Company              string   `protobuf:"bytes,4,opt,name=company,proto3" json:"company,omitempty"`
	Skills               []string `protobuf:"bytes,5,rep,name=skills,proto3" json:"skills,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*UserInfo) Descriptor

func (*UserInfo) Descriptor() ([]byte, []int)

func (*UserInfo) GetAge

func (m *UserInfo) GetAge() int32

func (*UserInfo) GetCompany

func (m *UserInfo) GetCompany() string

func (*UserInfo) GetGender

func (m *UserInfo) GetGender() int32

func (*UserInfo) GetName

func (m *UserInfo) GetName() string

func (*UserInfo) GetSkills

func (m *UserInfo) GetSkills() []string

func (*UserInfo) ProtoMessage

func (*UserInfo) ProtoMessage()

func (*UserInfo) Reset

func (m *UserInfo) Reset()

func (*UserInfo) String

func (m *UserInfo) String() string

func (*UserInfo) XXX_DiscardUnknown

func (m *UserInfo) XXX_DiscardUnknown()

func (*UserInfo) XXX_Marshal

func (m *UserInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*UserInfo) XXX_Merge

func (m *UserInfo) XXX_Merge(src proto.Message)

func (*UserInfo) XXX_Size

func (m *UserInfo) XXX_Size() int

func (*UserInfo) XXX_Unmarshal

func (m *UserInfo) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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