Skip to content

Commit 7f71cb6

Browse files
committed
Final copyedits before PR
1 parent cb09dea commit 7f71cb6

File tree

9 files changed

+357
-234
lines changed

9 files changed

+357
-234
lines changed

content/learning-paths/servers-and-cloud-computing/go-benchmarking-with-sweet/add_c4_vm.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,25 @@ weight: 30
66
layout: learningpathall
77
---
88

9-
## Overview
10-
In the previous section, you setup a c4a-standard-4. In this section, you will setup the second system used for benchmarking in this learning path, a c4-standard-8.
9+
## Section Overview
10+
In this section, you will set up the second benchmarking system, an Intel-based c4-standard-8 instance.
1111

12-
13-
### Creating the instance
12+
## Creating the Instance
1413

1514
To create the second system, follow the previous lesson's c4a install instructions, but make the following changes:
1615

16+
1. **Name your instance:** For the `Name` field, enter "c4".
1717

18-
1. For the `Name` field, and enter "c4".
19-
20-
2. Scroll down to the Machine series section, and select the C4 radio button.
18+
2. **Select machine series:** Scroll down to the Machine series section, and select the C4 radio button.
2119

2220
![](images/launch_c4/3.png)
2321

24-
3. Scroll down to the Machine type dropdown, and click it to show all available options.
22+
3. **View machine types:** Scroll down to the Machine type dropdown, and click it to show all available options.
2523

2624
![](images/launch_c4/4.png)
2725

28-
4. Select "c4-standard-8" under the Standard tab.
26+
4. **Choose machine size:** Select "c4-standard-8" under the Standard tab.
2927

3028
![](images/launch_c4/5.png)
3129

32-
33-
After the c4 starts up, and you are ready to continue on to the next section, where you'll install the benchmarking software.
30+
After the c4 instance starts up, you are ready to continue to the next section, where you'll install the benchmarking software.

content/learning-paths/servers-and-cloud-computing/go-benchmarking-with-sweet/add_c4a_vm.md

Lines changed: 17 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6,78 +6,62 @@ weight: 20
66
layout: learningpathall
77
---
88

9-
## Overview
10-
In this learning path, you'll learn how to benchmark Go code against two newly created systems. In this chapter, you bring up the first system, an Arm-based Google Axion c4a-standard-4 (c4a for short).
9+
## Section Overview
10+
In this section, you'll learn how to spin up the first of two different systems used in our benchmarking tests, an Arm-based Google Axion c4a-standard-4 (c4a for short).
1111

12-
### Creating the c4a-standard-4 instance
12+
## Creating the c4a-standard-4 Instance
1313

14-
1\. Navigate to [https://console.cloud.google.com/welcome](https://console.cloud.google.com/welcome)
14+
1. **Access Google Cloud Console:** Navigate to [https://console.cloud.google.com/welcome](https://console.cloud.google.com/welcome)
1515

16+
2. **Search for VM instances:** Click into the Search field.
1617

17-
2\. Click into the Search field.
18-
19-
20-
3\. Start typing `vm` until the UI auto-completes `VM Instances`, then click it.
18+
3. **Find VM Instances:** Start typing `vm` until the UI auto-completes `VM Instances`, then click it.
2119

2220
![](images/launch_c4a/3.png)
2321

2422
The VM Instances page appears.
2523

26-
5\. Click `Create instance`
24+
4. **Create a new instance:** Click `Create instance`
2725

2826
![](images/launch_c4a/4.png)
2927

3028
The Machine configuration page appears.
3129

32-
6\. Click the `Name` field, and enter "c4a" for the `Name`.
33-
30+
5. **Name your instance:** Click the `Name` field, and enter "c4a" for the `Name`.
3431

3532
![](images/launch_c4a/5.png)
3633

37-
38-
39-
8\. Scroll down to the Machine series section, and select the C4A radio button.
34+
6. **Select machine series:** Scroll down to the Machine series section, and select the C4A radio button.
4035

4136
![](images/launch_c4a/7.png)
4237

43-
44-
45-
9\. Scroll down to the Machine type dropdown, and click it to show all available options.
38+
7. **View machine types:** Scroll down to the Machine type dropdown, and click it to show all available options.
4639

4740
![](images/launch_c4a/8.png)
4841

49-
50-
51-
10\. Select "c4a-standard-4" under the Standard tab.
42+
8. **Choose machine size:** Select "c4a-standard-4" under the Standard tab.
5243

5344
![](images/launch_c4a/9.png)
5445

55-
56-
57-
11\. Click the "OS and Storage" tab.
46+
9. **Configure storage:** Click the "OS and Storage" tab.
5847

5948
![](images/launch_c4a/10.png)
6049

61-
62-
63-
12\. Click "Change"
50+
10. **Modify storage settings:** Click "Change"
6451

6552
![](images/launch_c4a/11.png)
6653

67-
68-
69-
13\. Double-click the "Size (GB)" field, then enter "1000" for the value.
70-
54+
11. **Set disk size:** Double-click the "Size (GB)" field, then enter "1000" for the value.
7155

7256
![](images/launch_c4a/16.png)
7357

74-
15\. Click "Select" to continue.
58+
12. **Confirm storage settings:** Click "Select" to continue.
7559

7660
![](images/launch_c4a/18.png)
7761

78-
16\. Click "Create" to bring up the instance.
62+
13. **Launch the instance:** Click "Create" to bring up the instance.
7963

8064
![](images/launch_c4a/19.png)
8165

82-
After a few seconds, our c4a starts up, and you are ready to continue on to the next section, where you will launch the second system, an Intel-based Emerald Rapids c4-standard-8 (c4 for short).
66+
After a few seconds, your c4a instance starts up, and you are ready to continue to the next section. In the next step, you will launch the second system, an Intel-based Emerald Rapids c4-standard-8 (c4 for short), which will serve as the comparison system for our benchmarking tests.
8367

content/learning-paths/servers-and-cloud-computing/go-benchmarking-with-sweet/installing_go_and_sweet.md

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,35 @@ weight: 40
66
layout: learningpathall
77
---
88

9-
## Installing Go and Sweet
10-
Now that you have your GCP VMs set up, it’s time to install Go, Sweet, and the Benchstat comparison tool on **both** VMs.
9+
## Section Overview
1110

12-
Copy and paste this script to **both** of your GCP VMs to automatically install all the needed Go and benchmarking dependencies:
11+
In this section, you'll install Go, Sweet, and the Benchstat comparison tool on both VMs.
1312

14-
```bash
15-
cat <<'EOF' > install_go_and_sweet.sh
13+
## Installation Script
14+
15+
Sweet is a Go benchmarking tool that provides a standardized way to run performance tests across different systems. Benchstat is a companion tool that analyzes and compares benchmark results, helping you understand performance differences between systems. Together, these tools will allow us to accurately measure and compare Go performance on Arm and x86 architectures.
16+
17+
18+
{{% notice Note %}}
19+
Subsequent steps in the learning path assume you are running this script (installing) from your home directory (`~`), resulting in the creation of a `~/benchmarks/sweet` final install path. If you decide to install elsewhere, adjust the path accordingly when prompted to run the benchmark logic later in the learning path.
20+
{{% /notice %}}
21+
22+
23+
Copy and paste this script to **both** of your GCP VMs.
24+
25+
**You don't need to run it after pasting**, just paste it into your home directory and press enter to install all needed dependencies:
1626

27+
```bash
1728
#!/usr/bin/env bash
1829

30+
# Write the script to filesystem using a HEREDOC
31+
cat <<'EOF' > install_go_and_sweet.sh
32+
1933
sudo apt-get -y update
2034
sudo apt-get -y install git build-essential
2135
22-
23-
# Detect architecture
36+
# Detect architecture - this allows the same script to work on both
37+
# our Arm (c4a) and x86 (c4) VMs without modification
2438
ARCH=$(uname -m)
2539
case "$ARCH" in
2640
arm64|aarch64)
@@ -70,14 +84,19 @@ CONFFILE
7084
7185
EOF
7286

87+
# Make the script executable
7388
chmod 755 install_go_and_sweet.sh
89+
90+
# Run the script
7491
./install_go_and_sweet.sh
7592

7693
```
7794

78-
To test that everything is installed correctly, run the following command on each VM post-script execution:
7995

8096

97+
## Verify Installation
98+
99+
To test that everything is installed correctly, run the following command on each VM after the script completes:
81100

82101
```bash
83102
# Run the benchmarks
@@ -90,11 +109,12 @@ sweet run -count 10 -run="markdown" config.toml # run one, 1X
90109

91110
You should see output similar to the following:
92111

93-
```output
112+
```bash
113+
# Example output:
94114
[sweet] Work directory: /tmp/gosweet3444550660
95115
[sweet] Benchmarks: markdown (10 runs)
96116
[sweet] Setting up benchmark: markdown
97117
[sweet] Running benchmark markdown for arm-benchmarks: run 1
98118
...
99119
[sweet] Running benchmark markdown for arm-benchmarks: run 10
100-
```
120+
```

content/learning-paths/servers-and-cloud-computing/go-benchmarking-with-sweet/manual_run_benchmark.md

Lines changed: 35 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,55 +6,59 @@ weight: 51
66
layout: learningpathall
77
---
88

9-
To begin, you'll run a benchmark by hand to get a feel for how `sweet` and `benchstat` work together.
9+
## Section Overview
1010

11-
### Run benchmarks on each machine
11+
In this section, you'll run benchmarks manually to understand how `sweet` and `benchstat` work together.
1212

13-
1. Navigate to the GCP [VM Instances](https://console.cloud.google.com/compute/instances) console.
13+
## Run Benchmarks on Each Machine
14+
The following explains how to run the benchmarks by hand on each machine.
1415

15-
2. Click on the `SSH` button next to your `c4a` instance.
16-
An SSH terminal will open in a new tab.
16+
1. **Access VM instances:** Navigate to the GCP [VM Instances](https://console.cloud.google.com/compute/instances) console.
1717

18-
![](images/run_manually/2.png)
18+
2. **Connect to c4a instance:** Click on the `SSH` button next to your `c4a` instance.
19+
An SSH terminal will open in a new tab.
1920

21+
![](images/run_manually/2.png)
2022

21-
3. Copy and paste the following into the SSH terminal to setup the environment and change to the sweet directory:
23+
3. **Set up environment:** Copy and paste the following into the SSH terminal to setup the environment and change to the sweet directory:
2224

23-
```bash
24-
cd benchmarks/sweet
25-
export GOPATH=$HOME/go
26-
export GOBIN=$GOPATH/bin
27-
export PATH=$PATH:$GOBIN:/usr/local/go/bin
28-
```
25+
```bash
26+
cd benchmarks/sweet
27+
export GOPATH=$HOME/go
28+
export GOBIN=$GOPATH/bin
29+
export PATH=$PATH:$GOBIN:/usr/local/go/bin
30+
```
2931

30-
![](images/run_manually/3.png)
32+
![](images/run_manually/3.png)
3133

3234
{{% notice Note %}}
3335
The above instructions assume you installed the benchmarks in the `~/benchmarks/sweet` directory. If you installed them elsewhere, adjust the path accordingly.
34-
{{% /notice %}}
36+
{{% /notice %}}
3537

36-
4. Copy and paste the following command to run the `markdown` benchmark with `sweet`:
3738

38-
```bash
39-
sweet run -count 10 -run="markdown" config.toml
40-
```
41-
5. After the benchmark completes, cd to the `results/markdown` directory and lists the files to see the `arm-benchmarks.result` file:
39+
4. **Run the benchmark:** Copy and paste the following command to run the `markdown` benchmark with `sweet`:
4240

43-
```bash
44-
cd results/markdown
45-
ls -d $PWD/*
46-
```
47-
6. Copy the absolute pathname of `arm-benchmarks.result`.
41+
```bash
42+
sweet run -count 10 -run="markdown" config.toml
43+
```
4844

49-
7. Click `DOWNLOAD FILE`, and paste the **FULL ABSOLUTE PATH** you just copied for the filename, and then click `Download`. This will download the benchmark results to your local machine.
45+
5. **Locate results:** After the benchmark completes, cd to the `results/markdown` directory and list the files to see the `arm-benchmarks.result` file:
5046

51-
![](images/run_manually/6.png)
47+
```bash
48+
cd results/markdown
49+
ls -d $PWD/*
50+
```
5251

53-
7. Once downloaded, on your local machine, rename this file to `c4a.result` so you can distinguish it from the x86 results you'll download later. You'll know the file downloaded successfully if you see the file in your Downloads directory with the name `c4a.result`, as well as the confirmation dialog in your browser:
52+
6. **Copy result path:** Copy the absolute pathname of `arm-benchmarks.result`.
5453

55-
![](images/run_manually/7.png)
54+
7. **Download results:** Click `DOWNLOAD FILE`, and paste the **ABSOLUTE PATHNAME** you just copied for the filename, and then click `Download`. This will download the benchmark results to your local machine.
5655

56+
![](images/run_manually/6.png)
5757

58-
8. Repeat steps 2-7 with your `c4` (x86) instance. Do everything the same, except after downloading the c4's `arm-benchmarks.result` file, rename it to `c4.result`.
58+
8. **Rename the file:** Once downloaded, on your local machine, rename this file to `c4a.result` so you can distinguish it from the x86 results you'll download later. This naming convention will help you clearly identify which results came from which architecture. You'll know the file downloaded successfully if you see the file in your Downloads directory with the name `c4a.result`, as well as the confirmation dialog in your browser:
5959

60-
Now that you have the results from both VMs, you can view and compare them using `benchstat`.
60+
![](images/run_manually/7.png)
61+
62+
9. **Repeat for c4 instance:** Repeat steps 2-8 with your `c4` (x86) instance. Do everything the same, except after downloading the c4's `arm-benchmarks.result` file, rename it to `c4.result`.
63+
64+
Now that you have the results from both VMs, in the next section, you'll learn how to use benchstat to analyze these results and understand the performance differences between the two architectures.

0 commit comments

Comments
 (0)