Skip to content

Commit 9eebc2c

Browse files
committed
Merge branch 'gh-pages' of github.com:edbennett/high-performance-python into gh-pages
2 parents 178408b + d68efc6 commit 9eebc2c

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

_episodes/02-design-constraints.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,21 @@ questions:
77
might want?"
88
- "What aspects of computer and supercomputer design allow us to work
99
around this?"
10+
objectives:
11+
- "Understand why Python code often runs more slowly than equivalent
12+
code in other languages, so that these can be mitigated"
13+
- "Understand how high performance is typically obtained from
14+
programs on HPC facilities"
15+
keypoints:
16+
- "Python is an implicitly-typed, interpreted language, meaning that
17+
we must do work to overcome this to gain performance comparable to
18+
compiled, explicitly-typed languages."
19+
- "Python has a Global Interpreter Lock, which allows performant
20+
single-threaded code at the expense of multithreading performance"
21+
- "Typically, performance is gained from efficient use of available
22+
vector units, CPU cores, accelerators such as GPUs, and nodes.
23+
We need to ensure that we don't accidentally stop our programs making
24+
use of these if we want to get optimal performance."
1025
---
1126

1227
## Characteristics of Python
@@ -138,7 +153,7 @@ Compare the execution of a loop element-by-element sequentially:
138153
with the execution of a vectorised loop:
139154
![An illustration of a vectorised loop](../fig/vector.svg)
140155

141-
The vectorised loop can be up to N times faster, where N is the number
156+
The vectorised loop can be up to $N$ times faster, where $N$ is the number
142157
of elements that fit into the processor's vector units.
143158

144159
Plain Python loops cannot be vectorised, since elements of a list aren't

_episodes/06-numpy-scipy.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@ questions:
66
- "How can I use Numpy to go faster on a single core?"
77
- "To what extent can Numpy exploit multiple cores?"
88
- "What can Scipy do to help in all this?"
9+
objectives:
10+
- "Understand how Numpy can give better performance than plain Python
11+
and when to use it"
12+
- "Be able to apply Numpy to multidimensional array problems"
13+
- "Understand when to look at Scipy for solutions"
14+
keypoints:
15+
- "Numpy provides datastructures for arbitrary-dimensional arrays
16+
of homogenous data"
17+
- "Whole-array operations are significantly faster than Python loops
18+
across arrays (or lists)"
19+
- "Scipy is very comprehensive; if you are doing something that someone
20+
has probable done before, then search to see if a library function
21+
exists before writing your own implementation, since it will
22+
probably be faster"
923
---
1024

1125
Earlier this morning we discussed how one source of overhead in Python

0 commit comments

Comments
 (0)