当前位置:网站首页>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 )
边栏推荐
- Lavarel之环境配置 .env
- UML state diagram
- OAuth 2.0 + JWT protect API security
- Million data document access of course design
- The longest ascending subsequence model acwing 1012 Sister cities
- Advanced Mathematics - Chapter 8 differential calculus of multivariate functions 1
- 请问指南针股票软件可靠吗?交易股票安全吗?
- bashrc与profile
- 常用数字信号编码之反向不归零码码、曼彻斯特编码、差分曼彻斯特编码
- [AI practice] Application xgboost Xgbregressor builds air quality prediction model (II)
猜你喜欢
Multi merchant mall system function disassembly lecture 01 - Product Architecture
js 获取当前时间 年月日,uniapp定位 小程序打开地图选择地点
The longest ascending subsequence model acwing 1014 Mountaineering
AI talent cultivation new ideas, this live broadcast has what you care about
Data flow diagram, data dictionary
Wired network IP address of VMware shared host
CVPR2022 | 医学图像分析中基于频率注入的后门攻击
Vscode configuration uses pylint syntax checker
Horizontal of libsgm_ path_ Interpretation of aggregation program
PERT图(工程网络图)
随机推荐
NDK beginner's study (1)
Interface automation test - solution of data dependency between interfaces
First choice for stock account opening, lowest Commission for stock trading account opening, is online account opening safe
Parsing of XML files
PERT图(工程网络图)
Mrs offline data analysis: process OBS data through Flink job
When FC connects to the database, do you have to use a custom domain name to access it outside?
c#通过frame 和 page 切换页面
OAuth 2.0 + JWT 保护API安全
Flask session forged hctf admin
Environment configuration of lavarel env
Leetcode - Sword finger offer 05 Replace spaces
Million data document access of course design
The longest ascending subsequence model acwing 1012 Sister cities
Equipment failure prediction machine failure early warning mechanical equipment vibration monitoring machine failure early warning CNC vibration wireless monitoring equipment abnormal early warning
Demis Hassabis谈AlphaFold未来目标
call undefined function openssl_cipher_iv_length
js 获取当前时间 年月日,uniapp定位 小程序打开地图选择地点
SSRF vulnerability file pseudo protocol [netding Cup 2018] fakebook1
[untitled]