当前位置:网站首页>Mmkv use and principle
Mmkv use and principle
2022-07-07 14:22:00 【LLAiden】
Basic use
implementation 'com.tencent:mmkv-static:1.2.9'
MMKV.initialize(this);
MMKV kv = MMKV.defaultMMKV();

From the input parameters of the stored function above, we found that it is actually used key,value Next, let's look at the storage method 
This storage method is actually a kind of packaging of the first storage method , But do it with SharedPreferences Basic compatibility in calling methods .
And SharedPreferences Compare
SharedPreferences
- advantage
1. Android Native support does not require the introduction of additional libraries
2. The data format is readable -
- shortcoming
1. The limitation of data format leads to more invalid data
2. Read and store using traditional IO It takes some time
3. The data format is limited, and the cost of local update is large
MMKV
- advantage
1. Use MMAP Mode and file mapping write time are greatly reduced
2. When local updates are appended to read later Map The mechanism automatically removes the weight
2. The number of customized data is invalid, and the amount of data is small
- shortcoming
1. Poor readability
2. Due to the increasing number of file addresses saved in the way of additional update ( When it reaches a certain amount, it will also be comprehensively updated to clean up duplicate data )
边栏推荐
- 手里的闲钱是炒股票还是买理财产品好?
- 一文读懂数仓中的pg_stat
- Search engine interface
- Introduction to sakt method
- The difference between memory overflow and memory leak
- Million data document access of course design
- Assign a dynamic value to the background color of DataGrid through ivalueconverter
- 【AI实战】应用xgboost.XGBRegressor搭建空气质量预测模型(二)
- Hands on Teaching: XML modeling
- Selenium Library
猜你喜欢

XML文件的解析操作

JS get the current time, month, day, year, and the uniapp location applet opens the map to select the location

多商户商城系统功能拆解01讲-产品架构

Horizontal of libsgm_ path_ Interpretation of aggregation program

Docker deploy Oracle

Details of redis core data structure & new features of redis 6

云上“视界” 创新无限 | 2022阿里云直播峰会正式上线

js 获取当前时间 年月日,uniapp定位 小程序打开地图选择地点

MRS离线数据分析:通过Flink作业处理OBS数据

GAN发明者Ian Goodfellow正式加入DeepMind,任Research Scientist
随机推荐
VSCode 配置使用 PyLint 语法检查器
The reason why data truncated for column 'xxx' at row 1 appears in the MySQL import file
C # switch pages through frame and page
Cesium 已知一点经纬度和距离求另一个点的经纬度
请问指南针股票软件可靠吗?交易股票安全吗?
Assign a dynamic value to the background color of DataGrid through ivalueconverter
UML 状态图
JS get the current time, month, day, year, and the uniapp location applet opens the map to select the location
Reverse non return to zero code, Manchester code and differential Manchester code of common digital signal coding
LeetCode 648. Word replacement
How to check the ram and ROM usage of MCU through Keil
UML sequence diagram (sequence diagram)
IP address home location query full version
C # use TCP protocol to establish connection
通过 iValueConverter 给datagrid 的背景颜色 动态赋值
Redis 核心数据结构 & Redis 6 新特性详
Environment configuration
常用数字信号编码之反向不归零码码、曼彻斯特编码、差分曼彻斯特编码
Search engine interface
Cascading update with Oracle trigger