Giter Site home page Giter Site logo

bxcodec / gotcha Goto Github PK

View Code? Open in Web Editor NEW
21.0 21.0 4.0 76 KB

gotcha: inmemory-cache in Go (Golang) with customizable algorithm

License: MIT License

Go 86.29% Makefile 7.64% Shell 6.07%
cache cache-control go go-cache golang gotcha inmemory inmemory-cache lfu-cache lru-cache lrucache

gotcha's Introduction

Iman Tumorang โ€” @bxcodec

Hi! I'm Iman!

Welcome to my Github Profile!

๐ŸŒฑ My Contributions So Far!

github stats

๐Ÿ“ My Latest Blog Post in Medium

๐Ÿ“ฎ Get In Touch!

gotcha's People

Contributors

bxcodec avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

gotcha's Issues

Introduce mutex

Iโ€™m pretty sure the internal maps require to be wrapped in sync.RWMutex read/write locks

LRU and LFU cache implementation

What a nice package you've been worked on! I learn how the algorithm behind the cache works through reading your implementation.

Btw, I have concerning something about the LRU and LFU cache implementation. I can't see the differences between both implementations in lfu.go and lru.go file. Is it better if we just merge them into one and let the Options decide its implementation by init the selected repository?

MaxMemory dangerous

Could you explain a reason to implement MaxMemory using a simple json/encoding to count the byte size? Because simple json/encoding using at least TWICE memory than actual objects!!! MaxMemory should keep memory usage in boundaries but instead it guarantee than memory boundaries would be breached. MaxMemory not just useless - it is dangerous in current implementation because actual memory usage 3 times more.

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.