Skip to content

Commit

Permalink
prepare for v1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lingol committed Jun 30, 2020
1 parent 8f613d0 commit c15450d
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 24 deletions.
3 changes: 0 additions & 3 deletions Android/MMKV/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ buildscript {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.1'
classpath 'digital.wup:android-maven-publish:3.6.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

Expand Down
2 changes: 1 addition & 1 deletion Android/MMKV/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ org.gradle.jvmargs=-Xmx1536m
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

VERSION_NAME_PREFIX=1.1.2
VERSION_NAME_PREFIX=1.2.0
#VERSION_NAME_SUFFIX=-SNAPSHOT
VERSION_NAME_SUFFIX=
6 changes: 3 additions & 3 deletions Android/MMKV/mmkvdemo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ repositories {

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation project(':mmkv')
// implementation 'com.tencent:mmkv:1.1.2'
// implementation 'com.tencent:mmkv-static:1.1.2'
// implementation project(':mmkv')
// implementation 'com.tencent:mmkv:1.2.0'
implementation 'com.tencent:mmkv-static:1.2.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# MMKV Change Log

## v1.2.0 / 2020-06-30
This is the second **major version** of MMKV. Everything you call is the same as the last version, while almost everything underneath has been improved.

* **Reduce Memory Usage**. We used to cache all key-values in a dictionary for efficiency. From now on we store the offset of each key-value inside the mmap-memory instead, **reducing memory usage by almost half** for (non-encrypt) MMKV. And the accessing efficiency is almost the same as before. As for encrypted MMKV, we can't simply store the offset of each key-value, the relative encrypt info needs to be stored as well. That will be too much for small key-values. We only store such info for large key-values (larger than 256B).
* **Improve writeback efficiency**. Thanks to the optimization above, we now can implement writeback by simply calling **memmove()** multiple times. Efficiency is increased and memory consumption is down.
* **Optimize small key-values**. Small key-values of encrypted MMKV are still cached in memory, as all the old versions did. From now on, the struct `MMBuffer` will try to **store small values in the stack** instead of the heap memory, saving a lot of time from malloc & free. In fact, all primitive types will be store in the stack memory.

All of the improvements above are available to all supported platforms. Here are the additional changes for each platform.

### iOS / macOS
* **Optimize insert & delete**. Especially for inserting new values to an **existing keys**, or deleting keys. We now use the UTF-8 encoded keys in the mmap-memory instead of live encoding from keys, cutting the cost of string encoding conversion.
* Fix Xcode compile error on some projects.

### POSIX
* It's known that GCC before 5.0 doesn't support C++17 standard very well. You should upgrade to the latest version of GCC to compile MMKV.

## v1.1.2 / 2020-05-29

### Android / iOS & macOS / Win32 / POSIX
Expand Down
2 changes: 1 addition & 1 deletion MMKV.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "MMKV"
s.version = "1.1.2"
s.version = "1.2.0"
s.summary = "MMKV is a cross-platform key-value storage framework developed by WeChat."

s.description = <<-DESC
Expand Down
4 changes: 2 additions & 2 deletions MMKVAppExtension.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "MMKVAppExtension"
s.version = "1.1.2"
s.version = "1.2.0"
s.summary = "MMKV is a cross-platform key-value storage framework developed by WeChat."
s.module_name = "MMKVAppExtension"

Expand Down Expand Up @@ -31,7 +31,7 @@ Pod::Spec.new do |s|
"GCC_PREPROCESSOR_DEFINITIONS" => "MMKV_IOS_EXTENSION",
}

s.dependency 'MMKVCore', '~> 1.1.2'
s.dependency 'MMKVCore', '~> 1.2.0'

end

2 changes: 1 addition & 1 deletion MMKVCore.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "MMKVCore"
s.version = "1.1.2"
s.version = "1.2.0"
s.summary = "MMKVCore for MMKV. MMKV is a cross-platform key-value storage framework developed by WeChat."

s.description = <<-DESC
Expand Down
4 changes: 2 additions & 2 deletions MMKVWatchExtension.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "MMKVWatchExtension"
s.version = "1.1.1"
s.version = "1.2.0"
s.summary = "MMKV is a cross-platform key-value storage framework developed by WeChat."
s.module_name = "MMKVWatchExtension"

Expand Down Expand Up @@ -31,7 +31,7 @@ Pod::Spec.new do |s|
"GCC_PREPROCESSOR_DEFINITIONS" => "MMKV_IOS_EXTENSION",
}

s.dependency 'MMKVCore', '~> 1.1.1'
s.dependency 'MMKVCore', '~> 1.2.0'

end

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![license](https://img.shields.io/badge/license-BSD_3-brightgreen.svg?style=flat)](https://github.com/Tencent/MMKV/blob/master/LICENSE.TXT)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/Tencent/MMKV/pulls)
[![Release Version](https://img.shields.io/badge/release-1.1.2-brightgreen.svg)](https://github.com/Tencent/MMKV/releases)
[![Release Version](https://img.shields.io/badge/release-1.2.0-brightgreen.svg)](https://github.com/Tencent/MMKV/releases)
[![Platform](https://img.shields.io/badge/Platform-%20Android%20%7C%20iOS%2FmacOS%20%7C%20Win32%20%7C%20POSIX-brightgreen.svg)](https://github.com/Tencent/MMKV/wiki/home)

中文版本请参看[这里](./readme_cn.md)
Expand Down Expand Up @@ -28,8 +28,8 @@ Add the following lines to `build.gradle` on your app module:

```gradle
dependencies {
implementation 'com.tencent:mmkv-static:1.1.2'
// replace "1.1.2" with any available version
implementation 'com.tencent:mmkv-static:1.2.0'
// replace "1.2.0" with any available version
}
```

Expand Down
12 changes: 6 additions & 6 deletions iOS/MMKV/MMKV.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.9;
MARKETING_VERSION = 1.1.2;
MARKETING_VERSION = 1.2.0;
"OTHER_LDFLAGS[sdk=iphoneos*]" = (
"-framework",
UIKit,
Expand Down Expand Up @@ -530,7 +530,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.9;
MARKETING_VERSION = 1.1.2;
MARKETING_VERSION = 1.2.0;
"OTHER_LDFLAGS[sdk=iphoneos*]" = (
"-framework",
UIKit,
Expand Down Expand Up @@ -740,7 +740,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.9;
MARKETING_VERSION = 1.1.2;
MARKETING_VERSION = 1.2.0;
"OTHER_LDFLAGS[sdk=iphoneos*]" = (
"-framework",
UIKit,
Expand Down Expand Up @@ -780,7 +780,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.9;
MARKETING_VERSION = 1.1.2;
MARKETING_VERSION = 1.2.0;
"OTHER_LDFLAGS[sdk=iphoneos*]" = (
"-framework",
UIKit,
Expand Down Expand Up @@ -826,7 +826,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.9;
MARKETING_VERSION = 1.1.2;
MARKETING_VERSION = 1.2.0;
"OTHER_LDFLAGS[sdk=iphoneos*]" = (
"-framework",
UIKit,
Expand Down Expand Up @@ -873,7 +873,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.9;
MARKETING_VERSION = 1.1.2;
MARKETING_VERSION = 1.2.0;
"OTHER_LDFLAGS[sdk=iphoneos*]" = (
"-framework",
UIKit,
Expand Down
4 changes: 2 additions & 2 deletions readme_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ MMKV 是基于 mmap 内存映射的 key-value 组件,底层序列化/反序列

```gradle
dependencies {
implementation 'com.tencent:mmkv-static:1.1.2'
// replace "1.1.2" with any available version
implementation 'com.tencent:mmkv-static:1.2.0'
// replace "1.2.0" with any available version
}
```

Expand Down

0 comments on commit c15450d

Please sign in to comment.