compare value before appending to to file #1143
Closed
kaitian521
started this conversation in
Ideas
Replies: 2 comments
-
Interesting idea. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Released with v1.3.2. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In my app, there exists a kind of blocks or ANRs.
Some keys are set to MMKV files frequently, but in many cases, the value for the key seldom change. For example, cloud configs from servers, some custom settings from user.
If a key is inserted to a file many times, it can lead to rewrite of file which can cause IO blocks
I spend some time to writing codes, compare values before set, just like below code
Then blocks here almost disappear in my app after compare values
so, would MMKV like to add some supports for this circumstances?
eg, consider adding a dozen of setX functions like:
setIntWithCompare
setStringWithCompare
setLongWithCompare
Thanks
===================== my tests ========================
In addition, the time of running gaps will be exaggerated in production environment: user's phone
Beta Was this translation helpful? Give feedback.
All reactions