SuperCache 0.0.1

SuperCache 0.0.1

Maintained by jianstm.



  • By
  • QuentinJin

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. : ]