-
Notifications
You must be signed in to change notification settings - Fork 513
Expand file tree
/
Copy pathoptimization-patterns.html
More file actions
68 lines (65 loc) · 3.55 KB
/
optimization-patterns.html
File metadata and controls
68 lines (65 loc) · 3.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
<title>Optimization Patterns · Game Programming Patterns</title>
<!-- Tell mobile browsers we're optimized for them and they don't need to crop
the viewport. -->
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" type="text/css" href="style.css" />
<link href="https://fonts.googleapis.com/css?family=Merriweather:400,400italic,700,700italic|Source+Code+Pro|Source+Sans+Pro:200,300,400,600,400italic,600italic|Rock+Salt" rel="stylesheet" type="text/css">
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-42804721-1', 'gameprogrammingpatterns.com');
ga('send', 'pageview');
</script>
<script src="jquery-3.6.0.min.js"></script>
<script src="script.js"></script>
</head>
<body id="top">
<div class="page sidebar">
<span class="theme-toggler" title="dark theme" onclick="toggleTheme()"></span>
<div class="content">
<nav class="top">
<span class="prev">← <a href="service-locator.html">Previous Chapter</a></span>
<span class="next"><a href="data-locality.html">Next Chapter</a> →</span>
<span class="toc">≡ <a href="/">The Book</a></span>
</nav>
<h1>Optimization Patterns</h1>
<h1 class="book"><a href="/">Game Programming Patterns</a></h1>
<p>While the rising tide of faster and faster hardware has lifted most software
above worrying about performance, games are one of the few remaining exceptions.
Players always want richer, more realistic and exciting experiences. Screens are
crowded with games vying for a player’s attention — and cash! — and the game
that pushes the hardware the furthest often wins.</p>
<p>Optimizing for performance is a deep art that touches all aspects of software.
Low-level coders master the myriad idiosyncrasies of hardware architectures.
Meanwhile, algorithms researchers compete to prove mathematically whose
procedure is the most efficient.</p>
<p>Here, I touch on a few mid-level patterns that are often used to speed up a
game. <a href="data-locality.html">Data Locality</a> introduces you to the modern
computer’s memory hierarchy and how you can use it to your advantage. The <a href="dirty-flag.html">Dirty
Flag</a> pattern helps you avoid unnecessary computation while
<a href="object-pool.html">Object Pools</a> help you avoid unnecessary allocation. <a href="spatial-partition.html">Spatial
Partitioning</a> speeds up the virtual world and its
inhabitants’ arrangement in space.</p>
<h2><a href="#the-patterns" name="the-patterns">The Patterns</a></h2>
<ul>
<li><a href="data-locality.html">Data Locality</a></li>
<li><a href="dirty-flag.html">Dirty Flag</a></li>
<li><a href="object-pool.html">Object Pool</a></li>
<li><a href="spatial-partition.html">Spatial Partition</a></li>
</ul>
<nav>
<span class="prev">← <a href="service-locator.html">Previous Chapter</a></span>
<span class="next"><a href="data-locality.html">Next Chapter</a> →</span>
<span class="toc">≡ <a href="/">The Book</a></span>
</nav>
</div>
</div>
<footer>© 2009-2021 Robert Nystrom</footer>
</body>
</html>