Comments (10)
Mainly because NSDictionary's value type is uncertain, it's hard to encode/decode NSDictionary properly in protobuf, if not possible.
However, you can turn a NSDictionary into a NSData by NSArchive, and store that NSData in MMKV.
from mmkv.
+1
from mmkv.
NSUserDefault can read/write NSDictionary directly, and MMKV needs to do a conversion through NSArchive. If you consider the consumption of conversion, is the performance advantage of MMKV still greater than NSUserDefault?
from mmkv.
NSUserDefault can read/write NSDictionary directly, and MMKV needs to do a conversion through NSArchive. If you consider the consumption of conversion, is the performance advantage of MMKV still greater than NSUserDefault?
Well, NSUserDefault's NSDictionary support doesn't come in free. Which algorithm do you think it used to store NSDictionary? NSArchive? I haven't test it yet, but that's my best guess.
Given that guess, I have confidence MMKV will beat NSUserDefault in such case.
from mmkv.
thx~
from mmkv.
you tell me I should better convert dictionary or Nsarray to NSData ,not the jsonStr , the reason is ( value type is uncertain, it's hard to encode/decode NSDictionary properly)? when I conert to jsonStr , all is NSString ,
or have other reason ?
from mmkv.
you tell me I should better convert dictionary or Nsarray to NSData ,not the jsonStr , the reason is ( value type is uncertain, it's hard to encode/decode NSDictionary properly)? when I conert to jsonStr , all is NSString ,
or have other reason ?
Use NSData for efficiency, or JSON for convenience. It's your choice.
from mmkv.
其实可以提供一个直接存 NSDictionary 的 api。然后内部进行一步转换~你觉得呢?
from mmkv.
其实可以提供一个直接存 NSDictionary 的 api。然后内部进行一步转换~你觉得呢?
Maybe.
from mmkv.
Supported with #78 , checkout release note.
from mmkv.
Related Issues (20)
- POSIX平台构建demo程序时报错 HOT 3
- MMKV for HarmonyOS NEXT 是否可以提供自定义对象的存取接口? HOT 4
- 多进程模式使用问题 HOT 1
- 在 HarmonyOS NEXT API 11 上初始化,发生崩溃,版本 : @tencent/mmkv":"1.3.5" HOT 1
- Fail to find any mmkv plugin dependencies HOT 3
- MMKV failed to build on iOS v1.3.5 HOT 4
- 一直有错误信息打印 HOT 1
- Query related to encryption key size increase HOT 1
- ohos中json字符串末尾分号丢失 HOT 4
- 鸿蒙 ide版本 Build Version: 5.0.3.100 api12 初始化的时候必现sysFreeze HOT 4
- MMKV crash (report from bugly) HOT 1
- Importing ArkTS files to JS and TS files is not allowed. <ArkTSCheck> HOT 4
- 鸿蒙导入MMKV初始化崩溃 HOT 3
- Thread 1: "MMKV not initialized properly, must call +initializeMMKV: in main thread before calling any other MMKV methods" HOT 16
- 鸿蒙版本存入字符串和取出字符串不匹配 HOT 1
- MMKV for HarmonyOS NEXT 在ts文件中无法使用 HOT 7
- 【建议】建议MMKV的python端打包发布 HOT 4
- Cocoapods 源最新版本1.2.16 ,没找到1.3.5 等版本 HOT 1
- 保存后,马上读能读到,但杀死app后读读不到 HOT 4
- 在模拟器上会crash,真机上运行正常,这是为啥? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mmkv.