zoukankan      html  css  js  c++  java
  • locality

     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.
     
     
     
     
  • 相关阅读:
    卡尔曼滤波器的简单推导
    data_quick 进度
    面试
    MapServer+TileCache+Apache+Python24 构建KS数据服务器
    PYTHONPATH 可以跨版本 方便使用 (本文为windows方法)转~
    20130923
    20130909
    error C2504 类的多层继承 头文件包含
    int long 等基础类型在不同平台的大小
    mysql python image 图像存储读取
  • 原文地址:https://www.cnblogs.com/rsapaper/p/6169541.html
Copyright © 2011-2022 走看看