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.
     
     
     
     
  • 相关阅读:
    简单跨域请求和带预检的跨域请求
    springmvc@RequestMapping-params参数规则
    ocketMQ概念模型
    java agent 详细介绍 -javaagent参数
    Spring使用多个 <context:property-placeholder/>
    什么时候会进行 SpringMVC重定向保存参数(FlashMap)?
    springMVC 数据模型相关注解 可注释类型 ModelAttribute SessionAttributes InitBinder
    Springmvc 异步处理
    Java并发包之阶段执行之CompletionStage接口
    Spring Web Flux 相关概念
  • 原文地址:https://www.cnblogs.com/rsapaper/p/6169541.html
Copyright © 2011-2022 走看看