Skip to main content
Explore
Log in
Get started
Someone wanted to learn this too, so Grasp built them a personal learning path.
Create your own
Golang
Module 1
Trustworthy Performance Baselines
1
Table-Driven Tests for Preserving Optimized Code Behavior
Write table-driven tests that preserve the behavior of code selected for optimization.
2
Benchmarking Go Code Without Setup and Teardown Time
Write a Go benchmark that excludes setup and teardown work from its timing.
3
Benchmarking HTTP Handlers with net/http/httptest
Benchmark an HTTP handler in memory with the net/http/httptest package.
4
Benchmarking a CLI’s Core with In-Memory I/O
Benchmark the processing core of a CLI using in-memory input and output.
5
Ensuring Reliable Benchmarks Against Dead-Code Elimination and Input Reuse
Prevent dead-code elimination and input reuse from invalidating benchmark results.
6
Measuring Time and Allocations per Operation in Go Benchmarks
Measure time and allocations per operation with Go's benchmark reporting.
7
Statistical Comparison of Repeated Benchmarks with benchstat
Compare repeated benchmark results statistically with benchstat.
Module 2
Race-Free Concurrency and Lifecycle Control
8
Diagnosing Shared-Memory Data Races in Go
Reproduce and diagnose a shared-memory data race with Go's race detector.
9
Protecting Shared State with Mutexes and Verifying Race Freedom
Protect shared mutable state with a mutex and verify that the fix is race-free.
10
Safely Coordinate Goroutines with sync.WaitGroup
Coordinate goroutine completion with sync.WaitGroup without calling Add or Wait unsafely.
11
Propagating Deadlines and Cancellation with Context.Context
Propagate deadlines and cancellation through concurrent work with context.Context.
12
Designing Safe Channel Ownership and Closure
Design channel ownership so that channels are closed exactly once by the responsible sender.
13
Prevent Goroutine Leaks with Cancellation-Aware Exits
Modify a goroutine to exit when cancellation occurs instead of leaking while blocked.
14
Implementing a Bounded Worker Pool for Concurrency Control
Implement a bounded worker pool that limits concurrent work.
Module 3
Measuring Concurrent Behavior
15
Measuring Throughput and Latency Under Controlled Concurrency
Measure throughput and latency percentiles under a controlled concurrent workload.
16
Benchmarking Concurrent Code with Multiple Parallelism Levels
Benchmark concurrent code at several parallelism levels with testing.B.RunParallel.
17
Impact of GOMAXPROCS on CPU-Bound Workloads
Measure how different GOMAXPROCS values affect a CPU-bound workload.
18
Interpreting Goroutine Dumps to Identify Blocking Operations
Read a goroutine dump to locate goroutines blocked on locks, channels, or I/O.
19
Identifying the Highest-Delay Blocking Operation
Capture a block profile and identify the blocking operation with the highest delay.
20
Identifying Costly Lock Contention with Mutex Profiles
Capture a mutex profile and identify the most costly lock contention.
21
Identifying Scheduler Delays with Go Tool Trace
Use go tool trace to identify scheduler delay affecting a selected request.
Module 4
CPU Profiling and Hotspot Optimization
22
Capturing CPU Profiles from Repeatable Benchmarks
Capture a CPU profile from a repeatable benchmark.
23
Interpreting Flat and Cumulative Costs in pprof Reports
Interpret flat and cumulative costs in a pprof top report.
24
Mapping CPU Hotspots to Source Lines with pprof list
Map a CPU hotspot to its source lines with pprof list.
25
Inspecting Hot Function Assembly with pprof Disassembly
Inspect compiler-generated assembly for a profiled hot function with pprof disasm.
26
Optimizing Algorithmic Hotspots with Lower-Complexity Solutions
Replace an algorithmic hotspot with a lower-complexity implementation.
27
Reducing Copying and Conversion in CPU Hotspots
Reduce copying and conversion work in a CPU hotspot.
28
Validate CPU Optimization with Correctness Tests and Benchmarks
Verify a CPU optimization against correctness tests and repeated benchmark results.
Module 5
Allocations, Escape Analysis, and Heap Profiles
29
Attribute Per-Operation Allocations to Source Lines Using Memory Profiles
Attribute per-operation allocations to source lines using a benchmark memory profile.
30
Comparing Alloc_space and Inuse_space Heap Profiles
Compare alloc_space and inuse_space heap profiles for the same workload.
31
Interpreting Escape Analysis: Why Values Move to the Heap
Use compiler escape-analysis output to explain why a selected value moves to the heap.
32
Preventing Escaping Allocations Through Ownership and Lifetime Control
Change a value's ownership or lifetime so that an avoidable allocation no longer escapes.
33
Preallocating Slices and Buffers with Capacity Estimates
Preallocate a slice or buffer using a measured capacity estimate.
34
Efficient String Construction Techniques
Replace repeated string concatenation with an allocation-efficient construction strategy.
35
Benchmarking Pointer-Based and Value-Based Data Structure Representations
Benchmark pointer-based and value-based representations for a selected data structure.
Module 6
Garbage Collection and Memory Control
36
Interpreting Garbage Collection Metrics
Read garbage-collection frequency and pause information from runtime metrics.
37
Allocation Rate vs. Garbage-Collection Frequency
Measure the relationship between allocation rate and garbage-collection frequency.
38
Benchmark Latency and Memory Across GOGC Settings
Benchmark latency and memory usage under multiple GOGC settings.
39
Applying Go’s Soft Memory Limit Under Load
Apply Go's soft memory limit and observe its effect under load.
40
Reducing Peak Heap Usage by Shortening Data Lifetimes
Reduce peak live-heap size by shortening the lifetime of retained data.
41
Evaluating sync.Pool Optimization with Allocation and Latency Measurements
Evaluate a sync.Pool optimization with allocation and latency measurements.
42
Identifying Memory Retention Paths with Comparative Heap Profiles
Use comparative heap profiles to identify an unintended memory retention path.
Module 7
Profiling and Tuning a Concurrent HTTP Service
43
Building a Fixed-Concurrency HTTP Load Driver
Build a repeatable HTTP load driver with fixed concurrency and request count.
44
Secure Profiling Endpoints on a Restricted Diagnostic Listener
Expose profiling endpoints on a separately restricted diagnostic listener.
45
Configuring HTTP Client Connection Reuse Under Concurrent Load
Configure an HTTP client transport to reuse connections under concurrent load.
46
Properly Closing and Draining Response Bodies for Connection Reuse
Close and drain response bodies correctly so that client connections can be reused.
47
Propagating Request Cancellation to Goroutines and I/O Operations
Propagate request cancellation to downstream goroutines and I/O operations.
48
Configuring Server Timeouts for Slow-Client Protection
Set server timeouts that bound slow-client resource consumption.
49
Optimizing HTTP Handler Serialization and Buffering Performance
Optimize a measured serialization or buffering hotspot in an HTTP handler.
Module 8
Efficient Concurrent Command-Line Pipelines
50
Stream Large Inputs Efficiently
Process a large input as a stream instead of loading it fully into memory.
51
Choosing the Optimal bufio Buffer Size Through Benchmarking
Choose a bufio buffer size using benchmark evidence.
52
Batch Output Writes for Reduced Overhead
Batch output writes to reduce write-call overhead.
53
Ordered Parallelization of CPU-Bound Pipeline Stages
Parallelize a CPU-bound pipeline stage while preserving output order.
54
Capping In-Flight Data to Control Memory Growth
Bound in-flight pipeline data to cap memory growth.
55
Fail-Fast Pipeline Error Handling
Propagate the first pipeline error and cancel the remaining stages.
56
Optimize Concurrent File Processing Limits
Tune concurrent file processing to avoid overwhelming storage or file-descriptor limits.
Module 9
Contention, Coordination, and Backpressure
57
Sharding Contended Maps to Reduce Lock Wait Time
Shard a contended map and measure the change in lock wait time.
58
Channel Ownership vs. Mutex Protection for Shared State
Compare channel ownership and mutex protection for the same shared-state workload.
59
Atomic Publication for Read-Mostly Shared Data
Replace a suitable read-mostly shared value with an atomic publication pattern.
60
Eliminating False Sharing Through Data-Layout Optimization
Demonstrate false sharing in a benchmark and remove it through data-layout changes.
61
Selecting Channel Capacity from Producer and Consumer Behavior
Select a channel capacity from measured producer and consumer behavior.
62
HTTP Admission Control Before Saturation
Implement admission control that rejects excess HTTP work before saturation.
63
Validating Backpressure Policies with Performance Metrics
Validate a backpressure policy using latency, throughput, and resource measurements.
Module 10
Evidence-Driven Optimization Capstone
64
Define Performance Targets for HTTP Service and CLI
Define measurable latency, throughput, CPU, and memory targets for the HTTP service and CLI.
65
Reproducible End-to-End Baselines for Capstone Programs
Record reproducible end-to-end baselines for both capstone programs.
66
Collecting Performance Evidence for a Failing Target
Collect CPU, allocation, blocking, and contention evidence for one failing target.
67
Prioritizing Optimization Hypotheses by Impact and Profiling Evidence
Rank optimization hypotheses by expected impact and strength of profiling evidence.
68
Implement One Evidence-Backed Optimization
Implement one evidence-backed optimization without combining unrelated changes.
69
Post-Optimization Validation Testing
Run correctness, race, benchmark, and load checks after the optimization.
70
Documenting Trade-Offs and Reversion Thresholds
Document the measured trade-off and a threshold for reverting the optimization.