All Projects → vpetrigo → Caches

vpetrigo / Caches

Licence: bsd-3-clause
LRU, LFU, FIFO cache C++ implementations

Programming Languages

cpp
1120 projects
cpp11
221 projects

Labels

Projects that are alternatives of or similar to Caches

Fastapi cache
FastAPI simple cache
Stars: ✭ 96 (-16.52%)
Mutual labels:  cache
Laravel Cacheable
Rinvex Cacheable is a granular, intuitive, and fluent caching system for eloquent models. Simple, but yet powerful, plug-n-play with no hassle.
Stars: ✭ 107 (-6.96%)
Mutual labels:  cache
Quitnow Cache
A collection to store data for a given time
Stars: ✭ 109 (-5.22%)
Mutual labels:  cache
Fast React Render
[DEPRECATED] Use last versions of React and Node.js for better performance
Stars: ✭ 102 (-11.3%)
Mutual labels:  cache
Ymate Platform V2
YMP是一个非常简单、易用的轻量级Java应用开发框架,涵盖AOP、IoC、WebMVC、ORM、Validation、Plugin、Serv、Cache等特性,让开发工作像搭积木一样轻松!
Stars: ✭ 106 (-7.83%)
Mutual labels:  cache
Keyv
Simple key-value storage with support for multiple backends
Stars: ✭ 1,629 (+1316.52%)
Mutual labels:  cache
Dotweb
Simple and easy go web micro framework
Stars: ✭ 1,354 (+1077.39%)
Mutual labels:  cache
Laravel Blink
Cache that expires in the blink of an eye
Stars: ✭ 114 (-0.87%)
Mutual labels:  cache
Gcache
An in-memory cache library for golang. It supports multiple eviction policies: LRU, LFU, ARC
Stars: ✭ 1,787 (+1453.91%)
Mutual labels:  cache
Python Memoization
A powerful caching library for Python, with TTL support and multiple algorithm options.
Stars: ✭ 109 (-5.22%)
Mutual labels:  cache
Wikipediap2p
WikipediaP2P.org Chrome Extension
Stars: ✭ 105 (-8.7%)
Mutual labels:  cache
Node Cache
a node internal (in-memory) caching module
Stars: ✭ 1,660 (+1343.48%)
Mutual labels:  cache
Caddy Cache
Caching middleware for caddy
Stars: ✭ 108 (-6.09%)
Mutual labels:  cache
Bojack
🐴 The unreliable key-value store
Stars: ✭ 101 (-12.17%)
Mutual labels:  cache
Framework
[NOT MAINTAINED] A full-featured PHP framework powering the server side of Webiny Platform. Can also be used as standalone library.
Stars: ✭ 110 (-4.35%)
Mutual labels:  cache
Memoize
A method caching macro for elixir using CAS on ETS.
Stars: ✭ 100 (-13.04%)
Mutual labels:  cache
Redis
Async Redis Client for PHP based on Amp.
Stars: ✭ 107 (-6.96%)
Mutual labels:  cache
Moyamapper
快速解析模型工具,支持RxSwift。同时支持缓存功能 【相关手册 https://MoyaMapper.github.io 】
Stars: ✭ 115 (+0%)
Mutual labels:  cache
Easyhttpcpp
A cross-platform HTTP client library with a focus on usability and speed
Stars: ✭ 110 (-4.35%)
Mutual labels:  cache
Liipcachecontrolbundle
DEPRECATED! This bundle is superseded by FOSHttpCacheBundle. A migration guide is in the README of LiipCacheControlBundle
Stars: ✭ 108 (-6.09%)
Mutual labels:  cache

Build Status Build status

C++ Cache implementation

This project implements a simple thread-safe cache with several page replacement policies:

  • Least Recently Used
  • First-In/First-Out
  • Least Frequently Used

More about cache algorithms and policy you could read on Wikipedia

Usage

Using this library is simple. It is necessary to include header with the cache implementation (cache.hpp file) and appropriate header with the cache policy if it is needed. If not then the non-special algorithm will be used (it removes the last element which key is the last in the internal container).

Currently there is only three of them:

  • fifo_cache_policy.hpp
  • lfu_cache_policy.hpp
  • lru_cache_policy.hpp

Example for the LRU policy:

#include <string>
#include "cache.hpp"
#include "lru_cache_policy.hpp"

// alias for easy class typing
template <typename Key, typename Value>
using lru_cache_t = typename caches::fixed_sized_cache<Key, Value, LRUCachePolicy<Key>>;

void foo(...) {
  constexpr std::size_t CACHE_SIZE = 256;
  lru_cache_t<std::string, int> cache(CACHE_SIZE);

  cache.Put("Hello", 1);
  cache.Put("world", 2);

  std::cout << cache.Get("Hello") << cache.Get("world") << std::endl;
  // "12"
}

Requirements

The only requirement is a compatible C++11 compiler.

This project was tested in the environments listed below:

  • MinGW64 (MSYS2 project)
    • Clang 3.8.0
    • GCC 5.3.0
  • MSVC (VS 2015)
  • FreeBSD
    • Clang 3.4.1

If you have any issues with the library building, let me know please.

Contributing

Please fork this repository and contribute back using pull requests. Features can be requested using issues. All code, comments, and critiques are greatly appreciated.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].