SuperCache
Extremely fast memory cache, written in Swift.
Features
- Hashable Key
- Ref/Val Type Value
- Similar Syntax to NSCache
- Cost, Count, Age Limit
- LRU
- Thread Safe
- Pure Swift
- Extremely Fast
π π π π π
Benchmark
Usage
let cache = MemoryCache<String, HeavyObject>()
cache.maxCount = 10000
cache.maxCost = 20 * 10000
cache.maxAge = 10 * 3600
cache.set(obj, forKey: "1", cost: 20)
let obj = cache.object(forKey: "1")
cache.removeObject(forKey: "1")
Contributing
Hanna is now a very naive framework, any help is welcome! You can open a issue on github and email me directly!
Roadmap
- DiskCache
More About SuperCache
η¨ Swift εδΈδΈͺζ΄εΏ«η iOS ε εηΌε
Acknowledgement
MemoryCache part is heavily inspired by YYCache, but much faster. : ]