• 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.
     
     
     
     
  • 相关阅读:
    iOS常用的终端指令
    instancesRespondToSelector与respondsToSelector的区别
    Struts2(一)快速入门
    pl/sql快速输入select * from等语句快捷键设置
    win10系统安装oracle11g时遇到INS-13001环境不满足最低要求
    JSP四大作用域
    J2EE开发模式
    JAVA四大域对象总结
    Apache与Tomcat有什么关系和区别
    Junit测试框架
  • 原文地址:https://www.cnblogs.com/rsapaper/p/6169541.html
Copyright © 2020-2023  润新知