Skip to content

Commit e2e08ca

Browse files
Merge pull request #2086 from madeline-underwood/go/sweet
Go/sweet_JA to check
2 parents ff2d840 + 9656b57 commit e2e08ca

File tree

10 files changed

+198
-167
lines changed

10 files changed

+198
-167
lines changed

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

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
11
---
2-
title: Go Benchmarks with Sweet and Benchstat
3-
4-
draft: true
5-
cascade:
6-
draft: true
2+
title: Benchmark Go performance with Sweet and Benchstat
73

84
minutes_to_complete: 60
95

10-
who_is_this_for: This is an introductory topic for developers who are interested in measuring the performance of Go-based applications on Arm-based servers.
6+
who_is_this_for: This introductory topic is for developers who want to measure and compare the performance of Go applications on Arm-based servers.
117

12-
learning_objectives:
13-
- Learn how to start up Arm64 and x64 instances of GCP VMs
14-
- Install Go, benchmarks, benchstat, and sweet on the two VMs
15-
- Use sweet and benchstat to compare the performance of Go applications on the two VMs
8+
learning_objectives:
9+
- Provision Arm64 and x86_64 VM instances on Google Cloud
10+
- Install Go, Sweet, and Benchstat on each VM instance
11+
- Run benchmarks and use Benchstat to compare Go application performance across architectures
1612

1713
prerequisites:
18-
- A [Google Cloud account](https://console.cloud.google.com/). This learning path can be run on on-prem or on any cloud provider instance, but specifically documents the process for running on Google Axion.
19-
- A local machine with [Google Cloud CLI](/install-guides/gcloud/) installed.
14+
- A [Google Cloud account](https://console.cloud.google.com/). This Learning Path can be run on any cloud provider or on-premises, but it focuses on Google Cloud’s Axion Arm64-based instances.
15+
- A local machine with [Google Cloud CLI](/install-guides/gcloud/) installed
2016

2117
author: Geremy Cohen
2218

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,31 @@
11
---
2-
title: Launching a Intel Emerald Rapids Instance
2+
title: Launch an Intel Emerald Rapids c4-standard-8 instance
33
weight: 30
44

55
### FIXED, DO NOT MODIFY
66
layout: learningpathall
77
---
88

9-
## Section Overview
10-
In this section, you will set up the second benchmarking system, an Intel Emerald Rapids `c4-standard-8` instance.
9+
In this section, you'll set up the second benchmarking system: an Intel-based Emerald Rapids `c4-standard-8` instance on Google Cloud (referred to as **c4**).
1110

12-
## Creating the Instance
11+
## Create the c4-standard-8 instance
1312

14-
To create the second system, follow the previous lesson's c4a install instructions, but make the following changes:
13+
Follow the same steps from the previous section where you launched the c4a instance, but make the following changes for the Intel-based c4-standard-8:
1514

16-
1. **Name your instance:** For the `Name` field, enter "c4".
15+
* In the **Name** field, enter "c4".
16+
* In the **Machine types for common workloads** section, select the **c4** radio button.
17+
![alt-text#center](images/launch_c4/3.png "Select the c4 radio button")
1718

18-
2. **Select machine series:** Scroll down to the Machine series section, and select the C4 radio button.
19+
* In the **Machine configuration** section, open the dropdown select `c4-standard-8`.
1920

20-
![](images/launch_c4/3.png)
21+
![alt-text#center](images/launch_c4/4.png "Open the dropdown and select `c4-standard-8`")
2122

22-
3. **View machine types:** Scroll down to the Machine type dropdown, and click it to show all available options.
23+
* In the **Machine type** section, open the dropdown and select `c4-standard-8` under the **Standard** tab.
2324

24-
![](images/launch_c4/4.png)
25+
![alt-text#center](images/launch_c4/5.png "Select `c4-standard-8`")
2526

26-
4. **Choose machine size:** Select "c4-standard-8" under the Standard tab.
27-
28-
![](images/launch_c4/5.png)
29-
30-
{{% notice Note %}} Don't forget to set the disk size for this c4 to 1000GB under the "OS and Storage" tab like you did for the c4a.{{% /notice %}}
27+
{{% notice Note %}}
28+
Be sure to set the disk size to **1000 GB** in the **OS and Storage** tab, just as you did for the `c4a` instance.
29+
{{% /notice %}}
3130

3231
After the c4 instance starts up, you are ready to continue to the next section, where you'll install the benchmarking software.
Lines changed: 28 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,62 @@
11
---
2-
title: Launching a Google Axion Instance
2+
title: Launch an Arm-based c4a-standard-4 instance
33
weight: 20
44

55
### FIXED, DO NOT MODIFY
66
layout: learningpathall
77
---
88

9-
## Overview
10-
In this section, you'll learn how to spin up the first of two different VMs used for benchmarking Go tests, an Arm-based Google Axion c4a-standard-4 (c4a for short).
9+
In this section, you'll launch the first of two VMs used for benchmarking Go applications: the Arm-based c4a-standard-4 instance on Google Cloud, (referred to as "c4a").
1110

12-
## Creating the c4a-standard-4 Instance
11+
## Create the c4a-standard-4 instance
1312

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

16-
2. **Search for VM instances:** Click into the Search field.
15+
In the search bar at the top, start typing `vm`, then select **VM instances** when it appears.
1716

18-
3. **Find VM Instances:** Start typing `vm` until the UI auto-completes `VM Instances`, then click it.
17+
![alt-text#center](images/launch_c4a/3.png "Select VM instances")
1918

20-
![](images/launch_c4a/3.png)
19+
On the **VM instances** page, click **Create instance**.
2120

22-
The VM Instances page appears.
21+
![alt-text#center](images/launch_c4a/4.png "Select Create instance")
2322

24-
4. **Create a new instance:** Click `Create instance`
23+
In the **Name** field, enter the name of the instance - here it should be `c4a`.
2524

26-
![](images/launch_c4a/4.png)
25+
![alt-text#center](images/launch_c4a/5.png "Enter name of the instance")
2726

28-
The Machine configuration page appears.
27+
Now select the machine series by scrolling down to the Machine series section, and selecting the **C4A** radio button.
2928

30-
5. **Name your instance:** Click the `Name` field, and enter "c4a" for the `Name`.
29+
![alt-text#center](images/launch_c4a/7.png "Select C4A radio button")
3130

32-
![](images/launch_c4a/5.png)
31+
To view machine types, scroll down to the **Machine type** dropdown, and select it to show all available options.
3332

34-
6. **Select machine series:** Scroll down to the Machine series section, and select the C4A radio button.
33+
![alt-text#center](images/launch_c4a/8.png "Select Machine type dropdown")
3534

36-
![](images/launch_c4a/7.png)
35+
Now choose machine size by selecting **c4a-standard-4** under the **Standard** tab.
3736

38-
7. **View machine types:** Scroll down to the Machine type dropdown, and click it to show all available options.
37+
![alt-text#center](images/launch_c4a/9.png "Select machine size")
3938

40-
![](images/launch_c4a/8.png)
39+
To configure storage, select the **OS and Storage** tab.
4140

42-
8. **Choose machine size:** Select "c4a-standard-4" under the Standard tab.
41+
![alt-text#center](images/launch_c4a/10.png "Configure storage")
4342

44-
![](images/launch_c4a/9.png)
43+
To modify storage settings, select **Change**.
4544

46-
9. **Configure storage:** Click the "OS and Storage" tab.
45+
![alt-text#center](images/launch_c4a/11.png "Modify storage settings")
4746

48-
![](images/launch_c4a/10.png)
47+
To set disk size, select the **Size (GB)** field and enter "1000" for the value.
4948

50-
10. **Modify storage settings:** Click "Change"
49+
![alt-text#center](images/launch_c4a/16.png "Enter value in the Size (GB) field")
5150

52-
![](images/launch_c4a/11.png)
51+
Now confirm storage settings by selecting **Select** to continue.
5352

54-
11. **Set disk size:** Double-click the "Size (GB)" field, then enter "1000" for the value.
53+
![alt-text#center](images/launch_c4a/18.png "Confirm the selection of settings with the Select button")
5554

56-
![](images/launch_c4a/16.png)
55+
To launch the instance, select **Create** to bring up the instance.
5756

58-
12. **Confirm storage settings:** Click "Select" to continue.
57+
![alt-text#center](images/launch_c4a/19.png "Select the Create button to launch the instance")
5958

60-
![](images/launch_c4a/18.png)
59+
After a few seconds, your c4a instance is up and running, and you are ready to continue to the next section.
6160

62-
13. **Launch the instance:** Click "Create" to bring up the instance.
63-
64-
![](images/launch_c4a/19.png)
65-
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 VM, an Intel-based Emerald Rapids c4-standard-8 (c4 for short), which will serve as the comparison system for our benchmarking tests.
61+
In the next section, you'll launch the second VM, an Intel-based Emerald Rapids c4-standard-8 (referred to as "c4"), which serves as the comparison system for benchmarking.
6762

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

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,39 @@
11
---
2-
title: Installing Go and Sweet
2+
title: Install Go, Sweet, and Benchstat
33
weight: 40
44

55
### FIXED, DO NOT MODIFY
66
layout: learningpathall
77
---
88

9-
In this section, you'll install Go, Sweet, and the Benchstat comparison tool on both VMs.
9+
In this section, you'll install Go, Sweet, and Benchstat on both virtual machines:
1010

11-
## Installation Script
12-
13-
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 you to accurately measure and compare Go performance on Arm and x86 architectures.
11+
* Sweet is a Go benchmarking tool that provides a standardized way to run performance tests across systems.
12+
* Benchstat is a companion tool that compares benchmark results to highlight meaningful performance differences.
1413

14+
Together, these tools help you evaluate Go performance on both Arm and x86 architectures.
1515

1616
{{% notice Note %}}
17-
Subsequent steps in the learning path assume you are running this script (installing) from your home directory (`$HOME`), resulting in the creation of a `$HOME/benchmarks/sweet` final install path. If you decide to install elsewhere, you will need to adjust the path accordingly when prompted to run the benchmark logic later in the learning path.
17+
Subsequent steps in this Learning Path assume you are running this script (installing) from your home directory (`$HOME`), resulting in the creation of a `$HOME/benchmarks/sweet` final install path. If you install to a different directory, update the paths in later steps to match your custom location.
1818
{{% /notice %}}
1919

20+
## Installation script
2021

21-
Start by copying and pasting the script below on **both** of your GCP VMs. This script checks the architecture of your running VM, installs the required Go package on your VM. It then installs sweet, benchmarks, and the benchstat tools.
22+
Start by copying and pasting the script below on both of your GCP VMs. This script automatically detects your system architecture, installs the appropriate Go version, and sets up Sweet, Benchstat, and the Go benchmark suite.
2223

23-
**You don't need to run it after pasting**, just paste it into your home directory and press enter to install all needed dependencies:
24+
Paste the full block into your terminal. This creates and runs an installer script directly from your home directory:
2425

2526
```bash
2627
#!/usr/bin/env bash
2728

28-
# Write the script to filesystem using a HEREDOC
29+
# Write the install script to filesystem using a HEREDOC
2930
cat <<'EOF' > install_go_and_sweet.sh
3031
3132
sudo apt-get -y update
3233
sudo apt-get -y install git build-essential
3334
3435
# Detect architecture - this allows the same script to work on both
35-
# our Arm (c4a) and x86 (c4) VMs without modification
36+
# Arm (c4a) and x86 (c4) VMs without modification
3637
ARCH=$(uname -m)
3738
case "$ARCH" in
3839
arm64|aarch64)
@@ -90,7 +91,9 @@ chmod 755 install_go_and_sweet.sh
9091

9192
```
9293

93-
The end of the output should look like:
94+
## Expected output from sweet get
95+
96+
When `sweet get` completes successfully, you’ll see output similar to:
9497

9598
```output
9699
Sweet v0.3.0: Go Benchmarking Suite
@@ -109,7 +112,7 @@ Usage: sweet get [flags]
109112
```
110113

111114

112-
## Verify Installation
115+
## Verify installation
113116

114117
To test that everything is installed correctly, set the environment variables shown below on each VM:
115118

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,44 @@
11
---
2-
title: Manually running benchmarks
2+
title: Manually run benchmarks
33
weight: 51
44

55
### FIXED, DO NOT MODIFY
66
layout: learningpathall
77
---
88

9-
In this section, you'll download the results of the benchmark you ran manually in the previous sections from each VM. You will use these results to understand how `sweet` and `benchstat` work together.
9+
In this section, you'll download the benchmark results you ran manually in previous steps from each VM. You will use these results to understand how `sweet` and `benchstat` work together.
1010

11-
## Download Benchmark Results from each VM
12-
Lets walk through the steps to manually download the sweet benchmark results from your initial run on each VM.
11+
## Download benchmark results from each VM
12+
Start by retrieving the results generated by Sweet from your earlier benchmark runs.
1313

1414

15-
1. **Locate results:** Change directory to the `results/markdown` directory and list the files to see the `arm-benchmarks.result` file:
15+
### Locate results
16+
17+
Change directory to the `results/markdown` directory and list the files to see the `arm-benchmarks.result` file:
1618

1719
```bash
1820
cd results/markdown
1921
ls -d $PWD/*
2022
```
2123

22-
2. **Copy result path:** Copy the absolute pathname of `arm-benchmarks.result`.
24+
### Copy result path
25+
26+
Copy the absolute pathname of `arm-benchmarks.result`. You'll need this to initiate the download.
27+
28+
### Download results
29+
30+
Select `DOWNLOAD FILE` in your GCP terminal interface. Paste the absolute pathname you copied into the dialog and confirm the download. This downloads the benchmark results to your local machine.
31+
32+
![alt-text#center](images/run_manually/6.png "Download the results")
2333

24-
3. **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.
34+
### Rename the file
2535

26-
![](images/run_manually/6.png)
36+
After downloading the file to your local machine, rename it to `c4a.result` to distinguish it from the x86 results you'll download next. This naming convention helps you clearly identify which architecture each result came from. You'll know the download was successful if you see the file named `c4a.result` in your Downloads folder and receive a confirmation in your browser.
2737

28-
4. **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:
38+
![alt-text#center](images/run_manually/7.png "A successful download")
2939

30-
![](images/run_manually/7.png)
40+
### Repeat for the second VM
3141

32-
5. **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`.
42+
Repeat the same process with your c4 (x86) VM. Use the same results/markdown directory and download the `arm-benchmarks.result` file. This time, rename it to `c4.result` after downloading.
3343

34-
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.
44+
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)