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)
- 初始化so 崩溃 HOT 3
- Bad JNI version returned from JNI_OnLoad HOT 3
- mmkv.decodeBytes() return null when encode an empty byte array HOT 3
- A native crash in colorOS-v1.3.2 HOT 11
- iOS17 系统 bugly卡顿上报有出现大量的 主线程死锁 HOT 5
- Why do I set the 'expireDurationInSecond' parameter but they don’t expire after the expiration time? HOT 2
- got crash on CodedInputData HOT 10
- [Help] Cross complie for aarch64(arm64) hosted on amd64 questions HOT 13
- Macro "release_key" defined in "MMKV.h" pullute the global scope. HOT 2
- Does MMKV implement custom encryption? HOT 2
- Android 接入1.3.2版本发生崩溃 HOT 4
- iOS multiProcess bugly会有卡死日志 HOT 1
- privacy manifest for third part sdk HOT 3
- 请问mmkv会在本地存储明文文件么? HOT 2
- flutter开发,升级AGP >=8,报错 HOT 2
- MMKV Crash HOT 11
- Duplicate class dalvik.annotation.optimization.FastNative HOT 5
- iOS singleProcessModel 数据丢失问题 HOT 8
- [iOS] Issues when archiving project HOT 3
- [POSIX] can't find ::unlink symbol HOT 6
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.