修改console缓存大小

Prerequisites: Memory mapping and its types

先决条件: 内存映射及其类型

While designing a cache system of a PC, the size of cache lines is an important parameter.

在设计PC的缓存系统时,缓存行的大小是重要的参数。

In the caching system, the size of the cache line affects a lot of parameters.

在缓存系统中,缓存行的大小会影响很多参数。

The following results show the effect of changing the cache block or line size in a caching system.

以下结果显示了在缓存系统中更改缓存块或行大小的影响。

1) In what ways changing block size affect spatial locality?

1)改变块大小会以什么方式影响空间局部性?

  • Spatial Locality indicates, if any word is in the cache then next time it will be referenced in a short amount of time.

    空间局部性表明,如果高速缓存中有任何单词,则下次将在很短的时间内引用它。

  • If the block size is large then the spatial locality will be better.

    如果块大小较大,则空间位置会更好。

  • By keeping the cache size constant, we have two cases as follows,

    通过保持高速缓存大小不变,我们有以下两种情况:

Case 1: Decreasing the Block Size

情况1:减小块大小

  • Smaller block size will contain a less number of nearby addresses in it. Thus, only a small number of nearby addresses will be brought into the cache.

    较小的块大小将在其中包含较少数量的附近地址。 因此,只有少量附近的地址将被带入高速缓存。

  • Due to the small size of the block increases the chances of cache miss which reduces the exploitation of spatial locality.

    由于块的小尺寸,增加了高速缓存未命中的机会,这减少了对空间局部性的利用。

  • Thus, smaller is the block size, inferior is the spatial locality.

    因此,块大小较小,空间局部性较差。

Case 2: Increasing the Block Size

情况2:增加块大小

  • A large block size will contain a number of nearby addresses in it. Thus, a larger number of nearby addresses will be brought into the cache.

    大的块大小将在其中包含许多附近的地址。 因此,大量附近的地址将被带入缓存。

  • This increases the chances of cache hit which increases the exploitation of spatial locality.

    这增加了缓存命中的机会,从而增加了对空间局部性的利用。

  • If the block size is large hen experiences better spatial locality.

    如果块大,则母鸡的空间定位更好。

2) In what ways changing block size affect On Cache Tag in Fully Associative Cache?

2)更改块大小会以什么方式影响完全关联缓存中的“缓存标签”?

Case 1: Decreasing the Block Size

情况1:减小块大小

  • If we are keeping the cache size constant and decreasing the block size then it will decrease the number of bits in block offset.

    如果我们保持高速缓存大小不变并减小块大小,那么它将减少块偏移量的位数。

  • With the decrease in the number of bits in block offset, the number of bits in tag increases.

    随着块偏移中位数的减少,标签中位数的增加。

Case 2: Increasing the Block Size

情况2:增加块大小

  • Keeping the cache size constant,

    保持高速缓存大小不变,

  • Increasing the block size increases the number of bits in block offset.

    增加块大小会增加块偏移量的位数。

  • With the increase in the number of bits in block offset, the number of bits in tag decreases.

    随着块偏移中位数的增加,标签中位数的减少。

3) In what ways changing block size affect on Cache Tag in Set Associative Cache?

3)更改块大小会以哪些方式影响Set Associative Cache中的Cache Tag?

Case 1: Decreasing the Block Size

情况1:减小块大小

  • If we are keeping the cache size constant it will increase the number of lines in the cache and also the number of sets in the cache then the number of bits in set number increases.

    如果我们保持高速缓存大小不变,则会增加高速缓存中的行数以及高速缓存中的集数,因此集数中的位数会增加。

  • When the block size decreases then the number of bits in block offset also decreases.

    当块大小减小时,块偏移量中的位数也会减少。

  • So, the number of bits in the set number and number of bits in block offset will remain constant that is no change on the cache tag.

    因此,设置数量中的位数和块偏移中的位数将保持不变,这在缓存标签上不会发生变化。

Case 2: Increasing the Block Size

情况2:增加块大小

  • If we are increasing the block size then it decreases the number of lines in the cache and increases the number of bits in block offset.

    如果我们要增加块大小,那么它将减少高速缓存中的行数,并增加块偏移量的位数。

  • With the decrease in the number of cache lines, the number of sets in cache decreases and also the number of bits in set number decreases.

    随着高速缓存行数量的减少,高速缓存中的集合数量减少,并且集合数量中的位数也减少。

  • So, the number of bits in the set number and number of bits in block offset will remain constant that is no effect on the cache tag.

    因此,设置数量中的位数和块偏移中的位数将保持不变,这对缓存标签没有影响。

4) In what ways Changing block size affect On Cache Miss Penalty?

4)更改块大小会以何种方式影响“高速缓存未命中罚款”?

  • When a cache miss happens, the required block of the word has to be brought from the main memory.

    当发生高速缓存未命中时,必须从主存储器中提取所需的字块。

  • Time taken to bring the block in the cache will be less if the block size is small. Hence, less miss penalty will incur.

    如果块大小较小,则将块放入高速缓存所需的时间会更少。 因此,将产生较少的未命中罚款。

  • If the block size is large so the time taken to bring the block in the cache will be more. Hence, more miss penalty will incur.

    如果块大小很大,那么将块带入缓存所需的时间会更多。 因此,将招致更多的未命中罚款。

5) In what ways changing block size affect on Cache Tag in Direct Mapped Cache?

5)更改块大小会以什么方式影响直接映射缓存中的缓存标签?

Case 1: Decreasing the Block Size

情况1:减小块大小

  • If we are keeping the cache size constant and decreasing the block size, this will increases the number of lines in the cache.

    如果我们保持高速缓存大小不变并减小块大小,这将增加高速缓存中的行数。

  • With the decrease in block size, the number of bits in block offset decreases.

    随着块大小的减小,块偏移的位数减少。

  • However, the number of bits in line number increases the cause of increasing the number of cache lines.

    但是,行号中的位数增加了导致高速缓存行数增加的原因。

  • With the increasing number of cache lines, the number of bits in line number together with the number of bits in block offset will remain constant that is there is no effect on the cache tag.

    随着高速缓存行数目的增加,行号中的位数和块偏移中的位数将保持不变,这对高速缓存标签没有影响。

Case 2: Increasing the Block Size

情况2:增加块大小

  • With increasing the block size the number of lines in cache decreases and the number of bits in block offset increases.

    随着块大小的增加,高速缓存中的行数减少,并且块偏移量中的位数增加。

  • However, with the decreasing number of cache lines, the number of bits in line number decreases.

    但是,随着高速缓存行的数量减少,行号中的位数减少。

  • So, the number of bits in line number and number of bits in block offset will remain constant. Hence, no effect on the cache tags.

    因此,行号中的位数和块偏移中的位数将保持不变。 因此,对缓存标签没有影响。

6) In what ways Cache Tag affect on Cache Hit Time?

6)缓存标记以什么方式影响缓存命中时间?

  • The time required to find out whether the required block is in cache or not is cache hit time.

    找出所需块是否在缓存中所需的时间是缓存命中时间。

  • It this comparing the tag of cache lines with the tag of the generated address.

    它将缓存行的标签与生成的地址的标签进行比较。

  • Hence, Smaller is the cache tag, lesser will be the time taken to perform the comparisons so smaller cache tag ensures lower cache hit time and larger is the cache tag results in a higher cache hit time.

    因此,缓存标签较小,执行比较所需的时间更少,因此较小的缓存标签可确保较低的缓存命中时间,而较大的缓存标签可导致较高的缓存命中时间。

References:

参考文献:

  • Set Associative Mapping | Set Associative Cache

    设置关联映射| 设置关联缓存

  • Cache performance measurement and metric

    缓存性能度量和指标

翻译自: https://www.includehelp.com/operating-systems/how-changing-the-line-size-of-cache-will-affect-other-parameters.aspx

修改console缓存大小

修改console缓存大小_更改缓存的行大小将如何影响其他参数?相关推荐

  1. Android记录20-获取缓存大小和清除缓存功能

    Android开发记录20-获取缓存大小和清除缓存功能 转载请注明:IT_xiao小巫  博客地址:http://blog.csdn.net/wwj_748 前言 本篇博客要给大家分享的如何获取应用缓 ...

  2. android 自动清理缓存图片吗,Android中Glide获取缓存大小并清除缓存图片

    清除Glide缓存 Glide自带清除缓存的功能,分别对应Glide.get(context).clearDiskCache();(清除磁盘缓存)与Glide.get(context).clearMe ...

  3. Android中获取缓存大小和清除缓存功能

    前言 本篇博客要给大家分享的如何获取应用缓存的大小和清除缓存的功能,我们知道我们应用当中经常会产生一些数据,比如图片的缓存,数据库文件,配置文件等等.我们开发产品的时候,可能会有这样的一个需求清除应用 ...

  4. 版本更新带来的缓存问题_浏览器缓存原理总结

    作者: Poetry 来源:http://blog.poetries.top/2019/01/02/browser-cache/ 一.浏览器缓存基本认识 分为强缓存和协商缓存 1.浏览器在加载资源时, ...

  5. 里面怎么缓存图片_浏览器缓存原理总结

    一.浏览器缓存基本认识 分为强缓存和协商缓存 1.浏览器在加载资源时,先根据这个资源的一些http header判断它是否命中强缓存,强缓存如果命中,浏览器直接从自己的缓存中读取资源,不会发请求到服务 ...

  6. Altium AD20批量修改丝印大小、更改丝印字体、丝印显示中文、更改位号丝印 相对元件的位置

    AD默认的丝印不大美观,那么多位号的丝印,想一个个单个去修改显得不现实.这里借助全局批量修改,快速更改丝印的字体.大小.显示中文.相对元件位置. AD20批量修改丝印大小.字体 选中其中一个丝印,右键 ...

  7. flutter 显示缓存大小,清理缓存功能

    Flutter 获取应用缓存需要借助于path_provider插件. path_provider 是一个用于查找文件系统上常用位置的Flutter插件.用来获取 Android 和 iOS 的缓存文 ...

  8. 本地缓存防止缓存击穿_防止缓存爆炸的快速提示

    本地缓存防止缓存击穿 在很多情况下,您都可以从应用程序中的常用对象缓存中受益,特别是在面向Web和微服务的环境中. 您可以在Java中执行的最简单的缓存类型可能是引入一个私有HashMap,在计算对象 ...

  9. java缓存击穿_对缓存击穿的一点思考

    点击上方"Java知音",选择"置顶公众号" 技术文章第一时间送达! 作者:张丰哲 www.jianshu.com/p/93767dac6b56 技术经验交流: ...

最新文章

  1. 一篇文章一张思维导图看懂Android学习最佳路线
  2. Django实战之增加链接
  3. Delphi数据类型及转换(附:源码)
  4. 设计模式--组合模式
  5. 网址由http转换成https
  6. 线程池---多线程学习笔记(三)
  7. python数据类型汇总_python基础数据类型汇总
  8. 一些数学小公式/定理的证明
  9. pycharm 如何自动添加头注释,比如时间,作者信息等
  10. pythonturtle是标准库_Python标准库: turtle--海龟绘图。
  11. scrapy 去重策略修改
  12. Thinkphp5.1 配置域名(站点)设置
  13. ASCII 码表对照 2
  14. (源码)智能优化算法—藤壶交配优化算法(Barnacles Mating Optimizer,BMO)
  15. atitit.导航的实现最佳实践and声明式编程
  16. MVC3.0 开发过程中遇到错误及解决方案(不断更新中。。。)
  17. “/”应用程序中的服务器错误(System.Data.OleDb.OleDbException: 操作必须使用一个可更新的查询)
  18. 投资理财-曾经一起投资理财的朋友们
  19. re的剩余模块和subprocess模块
  20. LeetCode 417.太平洋大西洋水流问题

热门文章

  1. 攻防世界web新手区解题 view_source / robots / backup
  2. 原神服务器维护后抽奖池会更新吗,原神:更新维护一小时,补偿60原石,玩家祈求多维护几天!...
  3. spark算子_Spark篇之持久化算子
  4. android添加删除项目,编写android计算器添加删除按钮,出现很抱歉,XX项目已停止运行。...
  5. 使用Phpstorm实现远程开发
  6. postman里测试文件上传(MultipartFile)
  7. vue内引入语音播报功能
  8. 微信小程序request请求动态获取数据
  9. 用MATLAB结合四种方法搜寻罗马尼亚度假问题
  10. WSFC真实场景仲裁处理