-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoptimization_guide.html-e
172 lines (168 loc) · 10.5 KB
/
optimization_guide.html-e
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<!-- begin SEO -->
<title>Optimization Guides</title>
<meta name="description" content="">
<meta property="og:locale" content="en">
<meta property="og:site_name" content="Home">
<meta property="og:title" content="Optimization Guides">
<link rel="canonical" href=alankelly.dev/optimization_guide.html/">
<meta property="og:url" content="alankelly.dev/optimization_guide.html/">
<meta property="og:description" content="">
<meta property="og:image" content="assets/images/first_photo.jpg">
<meta property="og:type" content="article">
<meta property="article:published_time" content="2019-04-23T00:00:00+00:00">
<script type="application/ld+json">
{
"@context" : "http://schema.org",
"@type" : "Person",
"name" : "Alan Kelly",
"url" : "//alankelly.dev"
}
</script>
<!-- end SEO -->
<!-- http://t.co/dKP3o1e -->
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script>
document.documentElement.className = document.documentElement.className.replace(/\bno-js\b/g, '') + ' js ';
</script>
<!-- For all browsers -->
<link rel="stylesheet" href="assets/css/main.css">
<meta http-equiv="cleartype" content="on">
<!-- start custom head snippets -->
<!-- insert favicons. use http://realfavicongenerator.net/ -->
<!-- end custom head snippets -->
<!-- Begin Jekyll SEO tag v2.5.0 -->
<title>Optimization Guides | Home</title>
<meta name="generator" content="Jekyll v3.8.5" />
<meta property="og:title" content="Optimization Guides" />
<meta name="author" content="Alan Kelly" />
<meta property="og:locale" content="en_US" />
<meta name="description" content="Personal Website and Blog." />
<meta property="og:description" content="Personal Website and Blog." />
<link rel="canonical" href=//alankelly.dev/optimization_guide.html" />
<meta property="og:url" content="//alankelly.dev/optimization_guide.html/" />
<meta property="og:site_name" content="Home" />
<meta property="og:type" content="article" />
<meta property="article:published_time" content="2019-04-23T00:00:00+00:00" />
<meta name="twitter:card" content="summary" />
<script type="application/ld+json">
{"author":{"@type":"Person","name":"Alan Kelly"},"@type":"BlogPosting","mainEntityOfPage":{"@type":"WebPage","@id":"optimization_guide.html"},"url":"optimization_guide.html/","headline":"Optimization Guides","dateModified":"2019-04-23T00:00:00+00:00","datePublished":"2019-04-23T00:00:00+00:00","description":"Personal Website and Blog.","@context":"http://schema.org"}
</script>
<!-- End Jekyll SEO tag -->
</head>
<body class="layout--single">
<!--[if lt IE 9]>
<div class="notice--danger align-center" style="margin: 0;">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</div>
<![endif]-->
<div class="masthead">
<div class="masthead__inner-wrap">
<div class="masthead__menu">
<nav id="site-nav" class="greedy-nav">
<ul class="visible-links">
<li class="masthead__menu-item masthead__menu-item--lg"><a href="//alankelly.dev/">Home</a></li>
<li class="masthead__menu-item"><a href="blog/">Blog</a></li>
<li class="masthead__menu-item"><a href="talks/">Talks</a></li>
<li class="masthead__menu-item"><a href="cv/">CV</a></li>
</ul>
<ul class="hidden-links hidden"></ul>
</nav>
</div>
</div>
</div>
<div class="page__hero--overlay"
style="background-color: #000; background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('assets/images/first_photo.jpg');"
>
<div class="wrapper">
<h1 class="page__title" itemprop="headline">
Optimization Guides
</h1>
<p class="page__lead"><br /><br /><br /></p>
</div>
</div>
<div id="main" role="main">
<div class="sidebar sticky">
<div itemscope itemtype="http://schema.org/Person">
<div class="author__avatar">
<img src="assets/images/me.png" class="author__avatar" alt="Alan Kelly" itemprop="image">
</div>
<div class="author__content">
<h3 class="author__name" itemprop="name">Alan Kelly</h3>
<p class="author__bio" itemprop="description">
Software Performance Expert
</p>
</div>
<div class="author__urls-wrapper">
<button class="btn btn--inverse">Follow</button>
<ul class="author__urls social-icons">
<li>
<script>
var emailAddress = ('me@' + 'alankelly.dev');
document.write('<a href="mailto:' + emailAddress + '">'
+ '<i class="fa fa-fw fa-envelope-square" aria-hidden="true"></i>'
+ " Email"
+ '</a>');
</script>
<li><a href="https://www.linkedin.com/in/alanjkelly" itemprop="sameAs">
<i class="fa fa-fw fa-linkedin-square" aria-hidden="true"></i>
LinkedIn
</a>
</li>
<li><a href="https://github.com/alankelly" itemprop="sameAs">
<i class="fa fa-fw fa-github" aria-hidden="true"></i>
Github
</a>
</li>
</ul>
</div>
</div>
</div>
<article class="page" itemscope itemtype="http://schema.org/CreativeWork">
<meta itemprop="headline" content="Optimization Guides">
<meta itemprop="description" content="">
<meta itemprop="datePublished" content="April 29, 2019">
<div class="page__inner-wrap">
<section class="page__content" itemprop="text">
<p>When writing and optimizing code, one very important resource I use very often are the <a href="https://software.intel.com/sites/landingpage/IntrinsicsGuide/">Intel Intrinsics Guide</a>and the Arm optimization guides. Arm publish a guide for each generation of processor, such as the <a href="https://static.docs.arm.com/101398/0200/arm_cortex_a75_software_optimization_guide_v2.pdf">Cortex A-75</a> These guides contain invaluable information such as latencies and throughputs for each cpu instruction, although the Intel one is not complete.</p>
<p>Agner Fog has published an <a href="https://www.agner.org/optimize/instruction_tables.pdf">Instruction Guide</a> in which he measured the latency and throughput of every instruction on each recent generation of x86 (Intel and AMD) processors. Information which is unavailable elsewhere, including vendor documentation and optimization guides is available here. These guides are an invaluable resource which I regularly use. He has also published other <a href="https://www.agner.org/optimize/#manuals">guides</a> which are very interesting and worth reading.</p>
<h3>Latency</h3>
<p>The latency of an instruction is the number of cycles it takes for its result to be available for use by another instruction. For example, if an integer addition instruction has a latency of 3, these means that it takes 3 cycles for its result to be available. In the expression a+b+c, the result of a+b is available after 3 cycles and that's when the addition of c to this result can start. The lower the latency, the better of course.</p>
<h3>Throughput</h3>
<p>The throughput of an instruction is the number of these instructions which can complete per cycle. If an integer addition has a throughput of two, this means that you can start a new addition after two cycles. For example, if you want to calculate a+b and c+d, the result of a+b will be available after 3 cycles and the result of c+d will be available after 5 cycles. However, if the input of an instruction depends on the output of another, it cannot start until the result is available. So, in the case of a+b+c, the result of a+b is available after 3 cycles, the second addition can only start when this result is available, so the final result will be available after 6 cycles.</p>
</section>
<footer class="page__meta">
<p class="page__date"><strong><i class="fa fa-fw fa-calendar" aria-hidden="true"></i> Updated:</strong> <time datetime="2019-04-29T00:00:00+00:00">April 29, 2019</time></p>
</footer>
<section class="page__share">
<h4 class="page__share-title">Share on</h4>
<a href="https://www.linkedin.com/shareArticle?mini=true&url=https://alankelly.dev/optimization_guide.html" class="btn btn--linkedin" title="Share on LinkedIn"><i class="fa fa-fw fa-linkedin" aria-hidden="true"></i><span> LinkedIn</span></a>
</section>
</div>
</article>
</div>
<div class="page__footer">
<footer>
<!-- start custom footer snippets -->
<!-- end custom footer snippets -->
<div class="page__footer-copyright">
© 2019 Alan Kelly.
<script>
var emailAddress = ('me@' + 'alankelly.dev');
document.write('<a href="mailto:' + emailAddress + '">'
+ '<i class="fa fa-fw fa-envelope-square" aria-hidden="true"></i>'
+ " Email"
+ '</a>');
</script>
<a href="https://www.linkedin.com/in/alanjkelly" itemprop="sameAs"><i class="fa fa-fw fa-linkedin-square" aria-hidden="true"></i>LinkedIn</a>
<a href="https://github.com/alankelly" itemprop="sameAs"><i class="fa fa-fw fa-github" aria-hidden="true"></i>Github</a>
</div>
</footer>
</div>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
</body>
</html>