A high-performance,
$O(1)$ LRU Cache Server built in C++ with persistent storage capabilities.
-
Constant Time Complexity:
$O(1)$ for bothgetandputoperations via Hash-Map and Doubly Linked List integration. - Smart Hydration: Tail-to-Head file serialization ensures cache priority is preserved across system restarts.
- Automatic Eviction: Self-managing memory limit with Least Recently Used (LRU) policy.
- Minimal Footprint: Zero external dependencies; optimized for embedded or sidecar use cases.
Results achieved from internal benchmarking [for 10k operations involving putValue() module]
- Throughput: ~24006 ops/sec
-
Time Complexity:
$O(1)$
Ensure you have
g++installed(makerecommended).
#clone the repo
git clone https://github.com/tecnolgd/velocache/#navigate to the project directory
cd velocacheFrom the project directory, run the following commands:
- Build both the server and the benchmark tool
makeor
make all- Build and run individualy
- The Server:
make v_server
- The Benchmark Tool:
make v_bench
- Clean object files:
make clean- The Server
- Build:
g++ src/cache.cpp src/storage.cpp apps/server.cpp utils/input_validation.cpp -I./include-03 -Wall -o build/v_server - Run:
./build/v_server- The Benchmark Tool
- Build:
g++ src/cache.cpp tests/benchmark.cpp -I./include-03 -Wall -o build/v_bench- Run:
./build/v_bench- Author: tecnolgd
- Version: v0.1.0-beta
- License: MIT License
