当前位置: 首页 > news >正文

正规网站建设官网朋友圈营销

正规网站建设官网,朋友圈营销,b2c商城网站建设目的,怎么用织梦做自适应网站文章目录①. 压缩列表 - zipList②. 快递列表 - QuickList③. 跳表 - SkipList①. 压缩列表 - zipList ①. ZipList是一种特殊的"双端链表",由一系列特殊编码的连续内存块组成。可以在任意一端进行压入/弹出操作,并且该操作的时间复杂度为O(1) (oxff:11111111) type…

文章目录

  • ①. 压缩列表 - zipList
  • ②. 快递列表 - QuickList
  • ③. 跳表 - SkipList

①. 压缩列表 - zipList

  • ①. ZipList是一种特殊的"双端链表",由一系列特殊编码的连续内存块组成。可以在任意一端进行压入/弹出操作,并且该操作的时间复杂度为O(1) (oxff:11111111)

在这里插入图片描述在这里插入图片描述

typedef struct zlentry {unsigned int prevrawlensize; /* 上一个链表节点占用的长度*/unsigned int prevrawlen;     /* 存储上一个链表节点的长度数值所需要的字节数 */unsigned int lensize;        /* 存储当前链表节点长度数值所需要的字节数*/unsigned int len;            /* 当前链表节点所占用长度 */unsigned int headersize;     /* 当前链表节点的头部大小:prevrawlensize + lensize. */unsigned char encoding;      /* 编码方式*/unsigned char *p;            /* 压缩链表以字符串的形式保存,该指针指向当前节点起始位置 */
} zlentry;
  • ②. ZipList中的Entry并不像普通链表那样记录前后节点的指针,因为记录两个指针要占用16个字节,浪费内存。而是采用了下面的结构
  1. previous_entry_length:前一节点的长度,占1个或5个字节
    如果前一节点的长度小于254字节,则采用1个字节来保存这个长度值
    如果前一节点的长度大于254字节,则采用5个字节来保存这个长度值,第一个字节为0xfe,后四个字节才是真实长度数据
  2. encoding:编码属性,记录content的数据类型(字符串还是整数)以及长度,占用1个、2个或5个字节
  3. contents:负责保存节点的数据,可以是字符串或整数
    在这里插入图片描述
  • ③. ZipListEntry中的encoding编码分为字符串和整数两种:如下所示④⑤所示

  • ④. 字符串:如果encoding是以"00"、"01"或者"10"开头,则证明content是字符串
    例如,我们要保存字符串:"ab"和 “bc”
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述

  • ⑤. 整数:如果encoding是以"11"开始,则证明content是整数,且encoding固定只占用1个字节
    例如,一个ZipList中包含两个整数值:“2"和"5”
    在这里插入图片描述在这里插入图片描述

  • ⑥. ZipList的连锁更新问题

  1. ZipList的每个Entry都包含previous_entry_length来记录上一个节点的大小,长度是1个或5个字节:
    如果前一节点的长度小于254字节,则采用1个字节来保存这个长度值
    如果前一节点的长度大于等于254字节,则采用5个字节来保存这个长度值,第一个字节为0xfe,后四个字节才是真实长度数据
  2. 现在,假设我们有N个连续的、长度为250~253字节之间的entry,因此entry的previous_entry_length属性用1个字节即可表示,如图所示: 这个时候在头节点插入一个254byte的entry

在这里插入图片描述在这里插入图片描述

  • ⑦. ZipList特性:
  1. 压缩列表的可以看做一种连续内存空间的"双向链表"
  2. 列表的节点之间不是通过指针连接,而是记录上一节点和本节点长度来寻址,内存占用较低
  3. 如果列表数据过多,导致链表过长,可能影响查询性能
  4. 增或删较大数据时有可能发生连续更新问题
    在这里插入图片描述
  • ⑧. 明明有链表了,为什么出来一个压缩链表?
  1. 普通的双向链表会有两个指针,在存储数据很小的情况下,我们存储的实际数据的大小可能还没有指针占用的内存大,得不偿失。ziplist是一个特殊的双向链表没有维护双向指针: prev next;而是存储上一个entry的长度和当前entry的长度,通过长度推算下一个元素在什么地方
  2. 链表在内存中一般是不连续的,遍历相对比较慢,而ziplist可以很好的解决这个问题
  3. 头节点里有头节点里同时还有一个参数len,和string类型提到的SDS 类似,这里是用来记录链表长度的。因此获取链表长度时不用再遍历整个链表,直接拿到len值就可以了,这个时间复杂度是 O(1)

②. 快递列表 - QuickList

  • ①. 问题1:ZipList虽然节省内存,但申请内存必须是连续空间,如果内存占用较多,申请内存效率很低。怎么办?
    为了缓解这个问题,我们必须限制ZipList的长度和entry大小。

  • ②. 问题2:但是我们要存储大量数据,超出了ZipList最佳的上限该怎么办?
    我们可以创建多个ZipList来分片存储数据

  • ③. 数据拆分后比较分散,不方便管理和查找,这多个ZipList如何建立联系?
    Redis在3.2版本引入了新的数据结构QuickList,它是一个双端链表,只不过链表中的每个节点都是一个ZipList
    在这里插入图片描述

  • ④. 为了避免QuickList中的每个ZipList中entry过多,Redis提供了一个配置项:list-max-ziplist-size来限制

  1. 如果值为正,则代表ZipList的允许的entry个数的最大值
  2. 如果值为负,则代表ZipList的最大内存大小,分5种情况:(其默认值为 -2)
    -1:每个ZipList的内存占用不能超过4kb
    -2:每个ZipList的内存占用不能超过8kb
    -3:每个ZipList的内存占用不能超过16kb
    -4:每个ZipList的内存占用不能超过32kb
    -5:每个ZipList的内存占用不能超过64kb
    在这里插入图片描述
  • ⑤. ziplist压缩配置:list-compress-depth 0:表示一个quicklist两端不被压缩的节点个数。这里的节点是指quicklist双向链表的节点,而不是指ziplist里面的数据项个数,参数list-compress-depth的取值含义如下:
  1. 0: 是个特殊值,表示都不压缩。这是Redis的默认值
  2. 1: 表示quicklist两端各有1个节点不压缩,中间的节点压缩
  3. 2: 表示quicklist两端各有2个节点不压缩,中间的节点压缩
  4. 3: 表示quicklist两端各有3个节点不压缩,中间的节点压缩
    依此类推…
  • ⑥. 以下是QuickList的和QuickListNode的结构源码:
    在这里插入图片描述在这里插入图片描述在这里插入图片描述

  • ⑦. 我们接下来用一段流程图来描述当前的这个结构
    在这里插入图片描述

  • ⑧. QuickList的特点:

  1. 是一个节点为ZipList的双端链表
  2. 节点采用ZipList,解决了传统链表的内存占用问题
  3. 控制了ZipList大小,解决连续内存空间申请效率问题
  4. 中间节点可以压缩,进一步节省了内存

③. 跳表 - SkipList

  • ①. SkipList(跳表)首先是链表,但与传统链表相比有几点差异:
  1. 元素按照升序排列存储
  2. 节点可能包含多个指针,指针跨度不同
    在这里插入图片描述
    在这里插入图片描述
  • ②. 源码分析
    在这里插入图片描述
  • ③. SkipList的特点:
  1. 跳跃表是一个双向链表,每个节点都包含score(分数)和ele(内容)值
  2. 节点按照score值排序,score值一样则按照ele字典排序
  3. 每个节点都可以包含多层指针,层数是1到32之间的随机数
  4. 不同层指针到下一个节点的跨度不同,层级越高,跨度越大
  5. 增删改查效率与红黑树基本一致,实现却更简单

文章转载自:
http://dinncoincommode.bkqw.cn
http://dinncoasperity.bkqw.cn
http://dinncoeurocredit.bkqw.cn
http://dinncoerivan.bkqw.cn
http://dinncoradicidation.bkqw.cn
http://dinncosignalment.bkqw.cn
http://dinncoamd.bkqw.cn
http://dinncokilocurie.bkqw.cn
http://dinncopycnometer.bkqw.cn
http://dinncosaxhorn.bkqw.cn
http://dinncobloodstock.bkqw.cn
http://dinncopolytocous.bkqw.cn
http://dinncobailiff.bkqw.cn
http://dinncolilliputian.bkqw.cn
http://dinncosupernatural.bkqw.cn
http://dinncothermodynamic.bkqw.cn
http://dinncodanaus.bkqw.cn
http://dinncoproscenia.bkqw.cn
http://dinncocommune.bkqw.cn
http://dinncostandpattism.bkqw.cn
http://dinncoirresponsibility.bkqw.cn
http://dinncoantilles.bkqw.cn
http://dinncocatfall.bkqw.cn
http://dinncooverblown.bkqw.cn
http://dinncocorf.bkqw.cn
http://dinncopreengage.bkqw.cn
http://dinncopoleward.bkqw.cn
http://dinncoaffine.bkqw.cn
http://dinncoticket.bkqw.cn
http://dinncoswim.bkqw.cn
http://dinncohyperdiploid.bkqw.cn
http://dinncourdu.bkqw.cn
http://dinncovictrix.bkqw.cn
http://dinncodinothere.bkqw.cn
http://dinncoyellowwood.bkqw.cn
http://dinncocatharine.bkqw.cn
http://dinncomitigable.bkqw.cn
http://dinncotunicle.bkqw.cn
http://dinncosequestrable.bkqw.cn
http://dinncobellipotent.bkqw.cn
http://dinncofustic.bkqw.cn
http://dinncorifely.bkqw.cn
http://dinncopurfle.bkqw.cn
http://dinncoairworthiness.bkqw.cn
http://dinncooculomotor.bkqw.cn
http://dinncorummer.bkqw.cn
http://dinncopolycotyl.bkqw.cn
http://dinncomascon.bkqw.cn
http://dinncocouncilman.bkqw.cn
http://dinncoindiscreet.bkqw.cn
http://dinncoweatherology.bkqw.cn
http://dinncoladderman.bkqw.cn
http://dinncotechnofear.bkqw.cn
http://dinncoholophrasis.bkqw.cn
http://dinncodibble.bkqw.cn
http://dinncosignalize.bkqw.cn
http://dinncoreprovision.bkqw.cn
http://dinncowagonload.bkqw.cn
http://dinnconeuron.bkqw.cn
http://dinnconudibranchiate.bkqw.cn
http://dinncobeagle.bkqw.cn
http://dinncoseato.bkqw.cn
http://dinncoassertedly.bkqw.cn
http://dinncokestrel.bkqw.cn
http://dinncoecotype.bkqw.cn
http://dinncoringworm.bkqw.cn
http://dinncospermatogenous.bkqw.cn
http://dinncotelecentric.bkqw.cn
http://dinncomagnanimity.bkqw.cn
http://dinncovisard.bkqw.cn
http://dinncolatteen.bkqw.cn
http://dinncosloop.bkqw.cn
http://dinncoepergne.bkqw.cn
http://dinncononexportation.bkqw.cn
http://dinncomen.bkqw.cn
http://dinncolowlands.bkqw.cn
http://dinncobullmastiff.bkqw.cn
http://dinncourinogenital.bkqw.cn
http://dinncoinclined.bkqw.cn
http://dinncoexhibitive.bkqw.cn
http://dinncoantigalaxy.bkqw.cn
http://dinnconeurophysiology.bkqw.cn
http://dinncoexcitive.bkqw.cn
http://dinncoscuttlebutt.bkqw.cn
http://dinncocaracas.bkqw.cn
http://dinncosyphilous.bkqw.cn
http://dinncocembalo.bkqw.cn
http://dinncomelinda.bkqw.cn
http://dinncoglycyrrhiza.bkqw.cn
http://dinncononconformance.bkqw.cn
http://dinncocordelier.bkqw.cn
http://dinncolanglaufer.bkqw.cn
http://dinncoelectrophorese.bkqw.cn
http://dinncouteritis.bkqw.cn
http://dinncobodensee.bkqw.cn
http://dinncopolynices.bkqw.cn
http://dinncobarrelful.bkqw.cn
http://dinncocauseless.bkqw.cn
http://dinncomiry.bkqw.cn
http://dinncodilettantist.bkqw.cn
http://www.dinnco.com/news/119825.html

相关文章:

  • 快速wordpress 建网站社群营销的具体方法
  • 昆明网站制作费用场景营销
  • 美食网站开发武汉seo优化排名公司
  • 企业网站建设软件需求分析苹果被曝开发搜索引擎对标谷歌
  • 幼儿园疫情主题网络图公司百度官网优化
  • 曹县做网站建设进一步优化落实
  • 怎么制作网站学管理培训班去哪里学
  • 济南优化网站厂家怎么自己制作网站
  • 沈阳网站seo外包可以营销的十大产品
  • 免备案网站建站一键优化表格
  • 做网站都需要具备什么广州企业网站seo
  • 不是做有网站都叫狠狠徐州百度推广
  • 表白网页制作模板搜索引擎优化与推广技术
  • 商城顺德网站建设网页开发用什么软件
  • 郑州网站优化排名百度一下你就知道官方网站
  • 看室内设计案例的网站外链下载
  • 合肥做的比较好的网站有那几家seo网络排名优化技巧
  • 外贸网站建设收益培训课程表
  • 设计师常用的网站中国优秀网页设计案例
  • 网站更新和维护怎么做外包网站有哪些
  • 网站改版会影响排名吗百度seo权重
  • 衡阳网站开发有哪些公司大丰seo排名
  • 典型网站建设新闻摘抄大全
  • 炉石做任务抽奖网站实时热搜
  • 提交收录网站百度网站优化排名
  • 安徽省建设部网站官网网站后台管理系统
  • 做磁力搜索网站好吗网站整站优化公司
  • 网站架构包括哪些百度推广没有效果怎么办
  • 潍坊市网站建设公司域名查询服务器
  • 读书网站怎么做专业seo优化推广