plugins icon indicating copy to clipboard operation
plugins copied to clipboard

feat: mmkv

Open triniwiz opened this issue 3 years ago β€’ 2 comments

Two versions of mmkv

MMKV is an efficient, small, easy-to-use mobile key-value storage framework used in the WeChat application

  1. mmkv uses gradle & cocoapods for the dependencies
  2. mmkv uses the cocoapods dependency for ios but on android an undocumented runtime feature which can be found here .

For mmkv-metal to work we will need this pr

The following are some sample call times for both versions

Action/Method Name Package time
Constructor Regular 0.515ms
Constructor Metal 0.056ms
contains Regular 0.071ms
contains Metal 0.006ms
set Regular 1.879ms
set Metal 0.765ms
getString Regular 0.148ms
getString Metal 0.009ms

Metal Version

Pros βœ… Cons :x:
Faster 🏎️ πŸ’¨ Will need to dive into to c++ 🀷🏽
Less Gc Calls Has to be built against runtime compatible v8 version ... so if the runtime upgrade you need to rebuild πŸ•ΊπŸ½
Increased lib size 😒 (could link against the rt vs libv8 πŸ’­ )

triniwiz avatar Sep 12 '22 05:09 triniwiz

I also included a nice localStorage shim around both plugins

triniwiz avatar Sep 12 '22 05:09 triniwiz

Any chance this can be merged ... without a blog post? :)

timdoege avatar May 30 '24 11:05 timdoege