当前位置:网站首页>Redis underlying data structure -- listpack
Redis underlying data structure -- listpack
2022-06-13 07:33:00 【A hard-working dog】
listpack Introduce
Redis stay 5.0 A new data structure called listpack, The purpose is to replace compressed lists , Its biggest feature is listpack Each node in no longer contains the length of the previous node , Each node in the compressed list needs to save the length field of the previous node , There will be a hidden danger of chain update .
listpack The structure design
listpack Many excellent designs with compressed lists , such as Or use a contiguous memory space to store data compactly , And to save memory overhead ,listpack Nodes use different encoding methods to save data of different sizes .
listpack There are four parameters
Total bytes Element quantity Node node End tag
listpack entry The node structure
encoding Define the encoding type of the element , Will encode integers and strings of different lengths
data Data actually stored
len,encoding+data The total length of
listpack There is no field in the compressed list to record the length of the previous node ,listpack Only record the length of the current node , When we turn to listpack When adding a new element , It will not affect the change of the length field of other nodes , Thus, the chain update problem of compressed list is avoided .
边栏推荐
- EF core execute SQL statement
- Precautions for passing parameters with byte array
- Through the function seaborn cubehelix_ Palette build order palette
- socket编程2:IO复用(select && poll && epoll)
- Priority analysis of list variables in ansible playbook and how to separate and summarize list variables
- Department store center supply chain management system
- Word document export
- The 'yarn' item cannot be recognized as the name of a cmdlet, function, script file, or runnable program
- Deploy RDS service
- [log4j2 log framework] modify dump log file permissions
猜你喜欢
RT thread simulator lvgl control: slider control
One article of quantitative framework backtrader read analyzer
How app inventor accesses resource files in assets directory
The biggest highlight of wwdc2022: metalfx
redis-6. Redis master-slave replication, cap, Paxos, cluster sharding cluster 01
Table access among Oracle database users
redis-5. Redis' RDB, fork, copyonwrite, AOF, RDB & AOF are mixed
TCP协议的三次握手过程和四次挥手过程以及为什么要这样? ------一二熊猫
Calculate running total / running balance
RT thread simulator lvgl control: button button event
随机推荐
量化框架backtrader之一文讀懂Analyzer分析器
Tree list under winfrom treelist related
What languages can be decompiled
10. process communication
理財產品連續幾天收益都是零是怎麼回事?
Postgraduate entrance examination English
[splashsplash] repeat the script that outputs splashsurf
AQS - detailed explanation of reentrantlock source code
平衡二叉树学习笔记------一二熊猫
Department store center supply chain management system
Wechat applet - positioning, map display, route planning and navigation
It's called the next generation monitoring system. Let's see how awesome it is
The biggest highlight of wwdc2022: metalfx
Redis learning journey sentinel mode
Redis learning journey -- subscription and publishing
Interview questions must be asked - Optimization of large table Pagination
. Net code to implement get request and post request
Related operations under Oracle Database
Quick sort
mysql中时间字段 比较时间大小