Skip to content

Commit 543f384

Browse files
committed
Update notes
1 parent fe33767 commit 543f384

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

images/throughput_1.png

8.91 KB
Loading

notes/performance-in-multithreading.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ schedule every task in a different core utilizing its hardware the best it can a
5454
- `# threads = # cores` is optimal only if all threads are runnable and can run without interruption (no IO / blocking calls / sleep etc.)
5555
- The assumption is that nothing else is running that consumes a lot of CPU.
5656

57+
> More threads than cores is **counter-productive**!
5758
5859
#### Hyper-threading
5960

@@ -77,4 +78,14 @@ We cannot run all the threads 100% in parallel, but we can get close to that!
7778

7879
The answer is NO!
7980

80-
- Small and trivial tasks are not worth breaking and running in parallel.
81+
- Small and trivial tasks are not worth breaking and running in parallel
82+
83+
84+
# Throughput
85+
86+
## When does it matter?
87+
88+
![When does it matter?](../images/throughput_1.png)
89+
90+
When we have a program that is given a concurrent flow of tasks and want to perform as many tasks as possible, as fast as possible.
91+
In that case **throughput** will be the right performance metric to evaluate the performance of our program.

0 commit comments

Comments
 (0)