Latest 0.0.1
Homepage https://github.com/jianstm/SuperCache
License MIT
Platforms ios 10.0, osx 10.12, requires ARC
Authors

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

SuperCache

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

Latest podspec

{
    "name": "SuperCache",
    "version": "0.0.1",
    "summary": "Extremely fast cache written in Swift.",
    "homepage": "https://github.com/jianstm/SuperCache",
    "license": {
        "type": "MIT",
        "file": "FILE_LICENSE"
    },
    "authors": {
        "QuentinJin": "[email protected]"
    },
    "platforms": {
        "ios": "10.0",
        "osx": "10.12"
    },
    "source": {
        "git": "https://github.com/jianstm/SuperCache.git",
        "tag": "0.0.1"
    },
    "source_files": "Sources/SuperCache/*.swift",
    "requires_arc": true,
    "swift_version": "4.0"
}

Pin It on Pinterest

Share This