remove valgrind, update docs

This commit is contained in:
illustris 2026-01-11 10:53:20 +05:30
parent 4f680b6a2d
commit c8f56cf3f1
Signed by: illustris
GPG Key ID: 56C8FC0B899FEFA3
3 changed files with 25 additions and 7 deletions

View File

@ -65,7 +65,6 @@ sudo apt install -y \
# Optional but recommended
sudo apt install -y \
hyperfine \
valgrind \
systemtap-sdt-dev
# Python tools
@ -125,7 +124,7 @@ Get all workshop tools in your current shell without installing anything system-
cd perf-workshop
nix develop
# Now you have: perf, strace, py-spy, bpftrace, hyperfine, valgrind, flamegraph, pyroscope
# Now you have: perf, strace, py-spy, bpftrace, hyperfine, flamegraph, pyroscope
perf --version
py-spy --help
```
@ -272,8 +271,11 @@ perf-workshop/
├── scenario4-cache-misses/
│ ├── README.md
│ ├── Makefile
│ ├── cache_demo.c # Row vs column major
│ └── list_vs_array.c # Array vs linked list
│ ├── matrix_col_major.c # BAD: Column-major traversal
│ ├── matrix_row_major.c # GOOD: Row-major traversal
│ ├── list_scattered.c # BAD: Scattered linked list
│ ├── list_sequential.c # MEDIUM: Sequential linked list
│ └── array_sum.c # GOOD: Contiguous array
├── scenario5-debug-symbols/
│ ├── README.md
│ ├── Makefile
@ -372,7 +374,6 @@ cat README.md
### Tools to Explore Later
- `bpftrace` - High-level tracing language
- `eBPF` - In-kernel programmability
- `Valgrind` - Memory profiling
- `gprof` - Traditional profiler
---

View File

@ -22,9 +22,8 @@ with pkgs; [
]))
py-spy
# Benchmarking and debugging
# Benchmarking and visualization
hyperfine
valgrind
flamegraph
# USDT/SDT support (provides sys/sdt.h)

View File

@ -134,6 +134,24 @@ Look at:
- `cpu-migrations`
- `instructions per cycle`
## Exercise 6: Benchmarking with hyperfine
Use `hyperfine` for proper statistical benchmarking with warmup runs:
```bash
hyperfine --warmup 1 './read_slow testfile' './read_fast testfile'
```
This gives you:
- Mean execution time with standard deviation
- Min/max times
- Direct comparison between implementations
For all three implementations:
```bash
hyperfine --warmup 1 './read_slow testfile' './read_stdio testfile' './read_fast testfile'
```
## Further Exploration
1. What happens with `read(fd, buf, 4096)` vs `read(fd, buf, 65536)`?