构造函数支持设置文件初始大小 #1135
Closed
kaitian521
started this conversation in
Ideas
构造函数支持设置文件初始大小
#1135
Replies: 5 comments
-
行,那我再提个pr? |
Beta Was this translation helpful? Give feedback.
0 replies
-
PR is always welcome. But I have to remind you that such changes better make it available to all supported languages and platforms. And that's a LOT of work. |
Beta Was this translation helpful? Give feedback.
0 replies
-
copy that. 我多测测 |
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
-
The language of MMKV
JAVA
The version of MMKV
1.3.0
The platform of MMKV
Android
The installation of MMKV
Maven
What's the issue?
目前MMKV在初始化时,默认创建的文件大小是4K(pagesize)。
但其实某些情况,开发者明确知道要存储的数据大约是多少:比如一个AB实验的参数或者线上云控等数据,假如说最少是20K,那么插入时必须要经历一次扩容,从 4K扩容到32K或者64K。
如果在初始化的时候直接指定64K,就可以避免一次扩容了。
所以可不可以在
增加一个默认参数,开发者可以指定映射文件大小,避免扩容,降低ANR发生概率
感谢。
Beta Was this translation helpful? Give feedback.
All reactions