GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — java-design-patterns/data-locality at master · tmollard/java-design-patterns

Expand file tree

/

data-locality

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
 
 
/

data-locality

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
etc
etc
 
 
src
src
 
 
README.md
README.md
 
 
pom.xml
pom.xml
 
 

README.md

Outline
layout pattern
title Data Locality
folder data-locality
permalink /patterns/data-locality/
categories Behavioral
tags
Game programming
Performance

Intent

Accelerate memory access by arranging data to take advantage of CPU caching.

Modern CPUs have caches to speed up memory access. These can access memory adjacent to recently accessed memory much quicker. Take advantage of that to improve performance by increasing data locality keeping data in contiguous memory in the order that you process it.

Class diagram

alt text

Applicability

  • Like most optimizations, the first guideline for using the Data Locality pattern is when you have a performance problem.
  • With this pattern specifically, you’ll also want to be sure your performance problems are caused by cache misses.

Real world example

  • The Artemis game engine is one of the first and better-known frameworks that uses simple IDs for game entities.

Credits

  • Game Programming Patterns Optimization Patterns: Data Locality
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.