Lab 4: Profiling and Memory Layout
2026-09-18
Primary goal: Work together on something
lab_04-0.1.0.crate on GradescopeThis lab is about getting going on Google Compute Engine and doing some timing and profiling.
VPC Network / VPC networkscs4414cs4414-[region]us-central110.0.0.0/24allow-ingress-from-iap35.235.240.0/2022, 33890.0.0.0/0 IP filter for port 22Compute Engine / VM instancesCreate Instance at the top of the screenc4d-highcpu-2 presetStandard provisioning, OS, and storage is fine
SSH into the VM instance and set things up:
Add to .profile
May want to exit and log back in to get these variables.
From the shell
Give samply access to performance events system:
If you want to read-write Cornell Github:
Then go to https://github.coecis.cornell.edu/, go to your account settings, and under SSH and GPG keys, copy this text in place.
Repo is at https://github.coecis.cornell.edu/cs4414-f26/lab-04
Can clone with ssh as:
or via HTTPS via
I default to the former (with an SSH key set up)
Can do this lab fully with the web interface, but may want CLI:
brew install --cask gcloud-cli)Then run gcloud init to set things up.
Set up a build profile for profiling
[profile.profiling]
inherits = "release"
debug = true
You probably want debug symbols! Try with just release profile to see why.
To run the profiler on sluggy:
You can Ctrl+C out (or hang on for the next slide)
Basic setup:
samply generates profile.json.gzYou can download profile.json.gz and view directly with the web app, or use the gcloud CLI to set up a tunnel:
Then point web browser to 127.0.0.1:3000
Repo: https://github.coecis.cornell.edu/cs4414-f26/lab-04
At the end of the hour
WRITEUP.mdCargo.toml and profile.json.gz (you will need to do some git config steps)cargo package and submit the crate file on Gradescope