Latest 0.3.0
Homepage https://github.com/RyanLeeLY/FastKV
License MIT
Platforms ios 8.0
Authors

Platform
Version
License MIT
Gmail
Twitter

中文介绍

Usage

[[FastKV defaultFastKV] setBool:YES forKey:@"key"];
[[FastKV defaultFastKV] setInteger:1 forKey:@"key"];
[[FastKV defaultFastKV] setObject:@"value" forKey:@"key"];

[[FastKV defaultFastKV] boolForKey:@"key"];
[[FastKV defaultFastKV] integerForKey:@"key"];
[[FastKV defaultFastKV] objectOfClass:NSString.class forKey:@"key"];

Memory Allocation

FastKV provides two kinds of memory allocation strategy.

typedef NS_ENUM(NSUInteger, FastKVMemoryStrategy) {
    FastKVMemoryStrategyDefalut = 0,
    FastKVMemoryStrategy1,
};

Doubling FastKVMemoryStrategyDefalut

size_t allocationSize = 1;
    while (allocationSize <= neededSize) {
        allocationSize *= 2;
    }
    return allocationSize;

Linear FastKVMemoryStrategy1

Reference python list

size_t allocationSize = (neededSize >> 3) + (neededSize < 9 ? 3 : 6);
return allocationSize + neededSize;

Installation

FastKV is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'FastKV'

Benchmark

iPhone 8 64G, iOS 11.4

Time taken of 10,000 write operations, unit: ms

Benchmark

Author

yao.li, [email protected]

License

FastKV is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "FastKV",
    "version": "0.3.0",
    "summary": "FastKV is a real-time and high-performance key-value components.",
    "description": "FastKV is a real-time and high-performance key-value components based on mmap.",
    "homepage": "https://github.com/RyanLeeLY/FastKV",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "yao.li": "[email protected]"
    },
    "source": {
        "git": "https://github.com/RyanLeeLY/FastKV.git",
        "tag": "0.3.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "FastKV/Classes/**/*"
}

Pin It on Pinterest

Share This