You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/go-benchmarking-with-sweet/add_c4_vm.md
+8-11Lines changed: 8 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,28 +6,25 @@ weight: 30
6
6
layout: learningpathall
7
7
---
8
8
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.
11
11
12
-
13
-
### Creating the instance
12
+
## Creating the Instance
14
13
15
14
To create the second system, follow the previous lesson's c4a install instructions, but make the following changes:
16
15
16
+
1.**Name your instance:** For the `Name` field, enter "c4".
17
17
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.
21
19
22
20

23
21
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.
25
23
26
24

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

31
29
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.
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/go-benchmarking-with-sweet/add_c4a_vm.md
+17-33Lines changed: 17 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,78 +6,62 @@ weight: 20
6
6
layout: learningpathall
7
7
---
8
8
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).
11
11
12
-
###Creating the c4a-standard-4 instance
12
+
## Creating the c4a-standard-4 Instance
13
13
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)
15
15
16
+
2.**Search for VM instances:** Click into the Search field.
16
17
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.
21
19
22
20

23
21
24
22
The VM Instances page appears.
25
23
26
-
5\. Click `Create instance`
24
+
4.**Create a new instance:** Click `Create instance`
27
25
28
26

29
27
30
28
The Machine configuration page appears.
31
29
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`.
34
31
35
32

36
33
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.
40
35
41
36

42
37
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.
46
39
47
40

48
41
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.
52
43
53
44

54
45
55
-
56
-
57
-
11\. Click the "OS and Storage" tab.
46
+
9.**Configure storage:** Click the "OS and Storage" tab.
58
47
59
48

60
49
61
-
62
-
63
-
12\. Click "Change"
50
+
10.**Modify storage settings:** Click "Change"
64
51
65
52

66
53
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.
71
55
72
56

73
57
74
-
15\. Click "Select" to continue.
58
+
12.**Confirm storage settings:** Click "Select" to continue.
75
59
76
60

77
61
78
-
16\. Click "Create" to bring up the instance.
62
+
13.**Launch the instance:** Click "Create" to bring up the instance.
79
63
80
64

81
65
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.
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/go-benchmarking-with-sweet/installing_go_and_sweet.md
+30-10Lines changed: 30 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,21 +6,35 @@ weight: 40
6
6
layout: learningpathall
7
7
---
8
8
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
11
10
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.
13
12
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:
16
26
27
+
```bash
17
28
#!/usr/bin/env bash
18
29
30
+
# Write the script to filesystem using a HEREDOC
31
+
cat <<'EOF' > install_go_and_sweet.sh
32
+
19
33
sudo apt-get -y update
20
34
sudo apt-get -y install git build-essential
21
35
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
24
38
ARCH=$(uname -m)
25
39
case "$ARCH" in
26
40
arm64|aarch64)
@@ -70,14 +84,19 @@ CONFFILE
70
84
71
85
EOF
72
86
87
+
# Make the script executable
73
88
chmod 755 install_go_and_sweet.sh
89
+
90
+
# Run the script
74
91
./install_go_and_sweet.sh
75
92
76
93
```
77
94
78
-
To test that everything is installed correctly, run the following command on each VM post-script execution:
79
95
80
96
97
+
## Verify Installation
98
+
99
+
To test that everything is installed correctly, run the following command on each VM after the script completes:
81
100
82
101
```bash
83
102
# Run the benchmarks
@@ -90,11 +109,12 @@ sweet run -count 10 -run="markdown" config.toml # run one, 1X
90
109
91
110
You should see output similar to the following:
92
111
93
-
```output
112
+
```bash
113
+
# Example output:
94
114
[sweet] Work directory: /tmp/gosweet3444550660
95
115
[sweet] Benchmarks: markdown (10 runs)
96
116
[sweet] Setting up benchmark: markdown
97
117
[sweet] Running benchmark markdown for arm-benchmarks: run 1
98
118
...
99
119
[sweet] Running benchmark markdown for arm-benchmarks: run 10
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/go-benchmarking-with-sweet/manual_run_benchmark.md
+35-31Lines changed: 35 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,55 +6,59 @@ weight: 51
6
6
layout: learningpathall
7
7
---
8
8
9
-
To begin, you'll run a benchmark by hand to get a feel for how `sweet` and `benchstat` work together.
9
+
## Section Overview
10
10
11
-
### Run benchmarks on each machine
11
+
In this section, you'll run benchmarks manually to understand how `sweet` and `benchstat` work together.
12
12
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.
14
15
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.
17
17
18
-

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.
19
20
21
+

20
22
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:
22
24
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
+
```
29
31
30
-

32
+

31
33
32
34
{{% notice Note %}}
33
35
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 %}}
35
37
36
-
4. Copy and paste the following command to run the `markdown` benchmark with `sweet`:
37
38
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`:
42
40
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
+
```
48
44
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:
50
46
51
-

47
+
```bash
48
+
cd results/markdown
49
+
ls -d $PWD/*
50
+
```
52
51
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`.
54
53
55
-

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.
56
55
56
+

57
57
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:
59
59
60
-
Now that you have the results from both VMs, you can view and compare them using `benchstat`.
60
+

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