Computer Systems A Programmer's Perspective Second Edition

Well-written computer programs tend to exhibit good
locality
. That is, they tend
to reference data items that are near other recently referenced data items, or
that were recently referenced themselves. This tendency, known as the
principle
of locality
, is an enduring concept that has enormous impact on the design and
performance of hardware and software systems.
 
 
Section 6.2 Locality

587
Locality is typically described as having two distinct forms:
temporal locality
and
spatial locality
. In a program with good temporal locality, a memory location
that is referenced once is likely to be referenced again multiple times in the near
future. In a program with good spatial locality, if a memory location is referenced
once, then the program is likely to reference a nearby memory location in the near
future.
 
Programmers should understand the principle of locality because, in general,

programs with good locality run faster than programs with poor locality
. All levels
of modern computer systems, from the hardware, to the operating system, to
application programs, are designed to exploit locality. At the hardware level, the
principle of locality allows computer designers to speed up main memory accesses
by introducing small fast memories known as
cache memories
that hold blocks of
the most recently referenced instructions and data items. At the operating system
level, the principle of locality allows the system to use the main memory as a cache
of the most recently referenced chunks of the virtual address space. Similarly, the
operating system uses main memory to cache the most recently used disk blocks in
the disk file system. The principle of locality also plays a crucial role in the design
of application programs. For example, Web browsers exploit temporal locality by
caching recently referenced documents on a local disk. High-volume Web servers
hold recently requested documents in front-end disk caches that satisfy requests
for these documents without requiring any intervention from the serve.
 
 
 
 

locality的更多相关文章

  1. [Algorithm] 局部敏感哈希算法(Locality Sensitive Hashing)

    局部敏感哈希(Locality Sensitive Hashing,LSH)算法是我在前一段时间找工作时接触到的一种衡量文本相似度的算法.局部敏感哈希是近似最近邻搜索算法中最流行的一种,它有坚实的理论 ...

  2. Locality Sensitive Hash 局部敏感哈希

    Locality Sensitive Hash是一种常见的用于处理高维向量的索引办法.与其它基于Tree的数据结构,诸如KD-Tree.SR-Tree相比,它较好地克服了Curse of Dimens ...

  3. 局部敏感哈希-Locality Sensitive Hashing

    局部敏感哈希 转载请注明http://blog.csdn.net/stdcoutzyx/article/details/44456679 在检索技术中,索引一直须要研究的核心技术.当下,索引技术主要分 ...

  4. LSH(Locality Sensitive Hashing)原理与实现

    原文地址:https://blog.csdn.net/guoziqing506/article/details/53019049 LSH(Locality Sensitive Hashing)翻译成中 ...

  5. spark - Locality Level

    这几个值在图中代表 task 的计算节点和 task 的输入数据的节点位置关系 PROCESS_LOCAL: 数据在同一个 JVM 中,即同一个 executor 上.这是最佳数据 locality. ...

  6. Locality Sensitive Hashing,LSH

    1. 基本思想 局部敏感(Locality Senstitive):即空间中距离较近的点映射后发生冲突的概率高,空间中距离较远的点映射后发生冲突的概率低. 局部敏感哈希的基本思想类似于一种空间域转换思 ...

  7. Spark笔记之数据本地性(data locality)

    一.什么是数据本地性(data locality) 大数据中有一个很有名的概念就是"移动数据不如移动计算",之所以有数据本地性就是因为数据在网络中传输会有不小的I/O消耗,如果能够 ...

  8. HBase基于region数目和data locality来balance regions

    1.  在Hbase的运维过程中,我们经常需要做如下操作: 移动 regionserver 到其他的 regionserver group中 下线一台机器 增加一台机器 移动 table 到其他 re ...

  9. 局部敏感哈希-Locality Sensitivity Hashing

    一. 近邻搜索 从这里开始我将会对LSH进行一番长篇大论.因为这只是一篇博文,并不是论文.我觉得一篇好的博文是尽可能让人看懂,它对语言的要求并没有像论文那么严格,因此它可以有更强的表现力. 局部敏感哈 ...

随机推荐

  1. ASP.NET 数据库访问通用工具

    在工作中,有很多项目已上线后,很多项目的数据库服务器都不会对外开放的,外网想直接访问客户数据库服务器时,可能会出现困难. 这时就需要一个可以查询,更新数据库操作的页面了: 本来用sql语句直接操作数据 ...

  2. 网页中meta标记

    网页中常常看见有这样的标记,他们是清浏览器缓存用的    <meta http-equiv="> PS:清除浏览器中的缓存,它和其它几句合起来用,就可以使你再次进入曾经访问过的页 ...

  3. android 广播

    关于广播以前感觉是一知半解的,这次看到同事整理的文档,顺带跟着再参考几篇博文也学习整理了下,先上个整理的图 代码模板 发送广播 public static final String RECEIVE_A ...

  4. loj 1168(Tarjan应用)

    题目链接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=26882 思路:一开始把题意理解错了,还以为是简单路径,然后仔细一看 ...

  5. CC2540开发板学习笔记(五)——串口通信

    (一)串口发送 一.实验现象: 开发板实现功能发送 二.实验过程 1.PL2303 USB转串口电路图 2.串口发送 (1)查看用户手册有: UART0 对应的外部设备 IO 引脚关系为: P0_2 ...

  6. 使用VIRTUALBOX安装ANDROID系统 | 图文教程 | 相关设置

    使用VIRTUALBOX安装ANDROID系统 | 图文教程 | 相关设置 http://icaoye.com/virtualbox-run-android/

  7. poj 1114 完全背包 dp

    如果可以每个物品拿多件,则从小到大遍历,否则从大到小遍历. G - Piggy-Bank Time Limit:1000MS     Memory Limit:32768KB     64bit IO ...

  8. 模拟 POJ 2996 Help Me with the Game

    题目地址:http://poj.org/problem?id=2996 /* 题意:给出白方和黑方的棋子和对应的坐标,输出该副棋盘的样子 模拟题 + 结构体排序:无算法,switch区分读入的字符,按 ...

  9. 【wikioi】1010 过河卒

    题目链接 算法:DFS+剪枝 14.01.02 PS: 递推应该也可以的,改天看看 刚开始最容易想到的是朴素搜索 #include <iostream> using namespace s ...

  10. 【wikioi】1230 元素查找(巨水题+set/hash)

    http://wikioi.com/problem/1230/ 这题我真的不好意思写题解了...set练手.. #include <cstdio> #include <set> ...