Coder Social home page Coder Social logo

workshop-depot / tinykv Goto Github PK

View Code? Open in Web Editor NEW
22.0 2.0 3.0 31 KB

tiny in-memory single-app kv (cache) with explicit and sliding expiration

License: MIT License

Go 100.00%
golang go kv-store inmemory embedded expiration expiration-callback

tinykv's Introduction

GoDoc Go Report Card

tinykv

tiny in-memory single-app kv (cache) with explicit and sliding expiration

v4

  • Heap-based expiration strategy

Get it using:

$ go get gopkg.in/dc0d/tinykv.v4

v3

  • Using only string keys,
  • Simplifying the interface,

Get it using:

$ go get gopkg.in/dc0d/tinykv.v3

v2

Get it using:

$ go get gopkg.in/dc0d/tinykv.v2

v1

Get it using:

$ go get gopkg.in/dc0d/tinykv.v1

Benchmarks:

$ go test -bench=.
BenchmarkGetNoValue-8          	20000000	        72.6 ns/op
BenchmarkGetValue-8            	20000000	        78.3 ns/op
BenchmarkGetSlidingTimeout-8   	10000000	       128 ns/op
BenchmarkPutOne-8              	10000000	       219 ns/op
BenchmarkPutN-8                	 2000000	       814 ns/op
BenchmarkPutExpire-8           	 2000000	       882 ns/op
BenchmarkCASTrue-8             	 5000000	       268 ns/op
BenchmarkCASFalse-8            	10000000	       260 ns/op

tinykv's People

Contributors

dc0d avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

tinykv's Issues

List all keys

It would be usefull to make "list all non-expired keys" method

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.