Skip to content

Commit ec678e5

Browse files
committed
chore: update README.md
1 parent 41fdb10 commit ec678e5

2 files changed

Lines changed: 71 additions & 56 deletions

File tree

README.md

Lines changed: 70 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -2,50 +2,62 @@
22

33
Brush up on C++ personally to be a real-time engineer in AI era. For fundamental jargon you must know, please visit [jargon.md](./docs/jargon.md).
44

5-
## Battlefield
5+
Contents
66

7-
```shell
8-
┌──────────────────────────────┐
9-
│ CPU │
10-
│ │
11-
│ ┌──────── Core 0 ────────┐ │ Core: Executes instructions
12-
│ │ Registers (R0..Rn) │ │ Register: Fastest storage
13-
│ │ L1 Cache (32KB) │ │ Instructions operate
14-
│ └────────────────────────┘ │ L1 Cache: Hot variables should live here
15-
│ │
16-
│ ┌──────── Core 1 ────────┐ │
17-
│ │ Registers (R0..Rn) │ │
18-
│ │ L1 Cache (32KB) │ │
19-
│ └────────────────────────┘ │
20-
│ │
21-
│ Shared L2 Cache │ L2 Cache: Bigger and slower than L1
22-
│ (per-core / small) │
23-
│ │
24-
│ ┌────────────────────────┐ │
25-
│ │ L3 Cache │ │ L3 Cache: Shared across cores
26-
│ │ (Shared, MBs) │ │ Bigger and slower than L2
27-
│ └────────────────────────┘ │
28-
└──────────────┬───────────────┘
29-
30-
Local Memory Controller
31-
32-
┌──────────────────┴──────────────────┐
33-
│ │
34-
RAM (NUMA Node 0) RAM (NUMA Node 1)
35-
~80ns latency ~150ns latency
36-
```
7+
[Battlefield](#battlefield)
8+
[Topics](#topics)
9+
[Allocators & Cache Behavior (Day 05)](#allocators--cache-behavior-day-05)
10+
[Practical Application](#practical-application)
3711

38-
How latency can grow...
12+
## Battlefield
3913

40-
```shell
41-
Instruction →
42-
uses Registers →
43-
if miss → L1 →
44-
miss → L2 →
45-
miss → L3 →
46-
miss → RAM (NUMA local?) →
47-
miss → RAM (NUMA remote)
48-
```
14+
<details>
15+
<summary> Click to expand/collapse </summary>
16+
17+
```shell
18+
┌──────────────────────────────┐
19+
│ CPU │
20+
│ │
21+
│ ┌──────── Core 0 ────────┐ │ Core: Executes instructions
22+
│ │ Registers (R0..Rn) │ │ Register: Fastest storage
23+
│ │ L1 Cache (32KB) │ │ Instructions operate
24+
│ └────────────────────────┘ │ L1 Cache: Hot variables should live here
25+
│ │
26+
│ ┌──────── Core 1 ────────┐ │
27+
│ │ Registers (R0..Rn) │ │
28+
│ │ L1 Cache (32KB) │ │
29+
│ └────────────────────────┘ │
30+
│ │
31+
│ Shared L2 Cache │ L2 Cache: Bigger and slower than L1
32+
│ (per-core / small) │
33+
│ │
34+
│ ┌────────────────────────┐ │
35+
│ │ L3 Cache │ │ L3 Cache: Shared across cores
36+
│ │ (Shared, MBs) │ │ Bigger and slower than L2
37+
│ └────────────────────────┘ │
38+
└──────────────┬───────────────┘
39+
40+
Local Memory Controller
41+
42+
┌──────────────────┴──────────────────┐
43+
│ │
44+
RAM (NUMA Node 0) RAM (NUMA Node 1)
45+
~80ns latency ~150ns latency
46+
```
47+
48+
How latency can grow...
49+
50+
```shell
51+
Instruction →
52+
uses Registers →
53+
if miss → L1 →
54+
miss → L2 →
55+
miss → L3 →
56+
miss → RAM (NUMA local?) →
57+
miss → RAM (NUMA remote)
58+
```
59+
60+
</details>
4961

5062
## Topics
5163

@@ -96,20 +108,22 @@ If your struct is poorly laid out:
96108
- You evict useful data
97109
- Latency explodes
98110

99-
```cpp
100-
struct Bad {
101-
bool flag;
102-
double price;
103-
bool active;
104-
}
105-
```
106-
107-
```cpp
108-
struct Good {
109-
double price;
110-
bool flag;
111-
bool active;
112-
}
113-
```
111+
```cpp
112+
struct Bad {
113+
bool flag;
114+
double price;
115+
bool active;
116+
}
117+
```
118+
119+
```cpp
120+
struct Good {
121+
double price;
122+
bool flag;
123+
bool active;
124+
}
125+
```
114126

115127
Group hot data together.
128+
129+
## Practical Application

src/python/_cli.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,5 @@ def main(
6969

7070
return
7171

72+
# Run the default simulation
7273
run_simulation(config_data["yolo"]["fps"])

0 commit comments

Comments
 (0)