Skip to content

syedazeez337/algorithms-in-cpp

Repository files navigation

algorithms-in-cpp

Hands-on algorithms and performance engineering with the Tracy profiler.
Platform focus: Windows (MSVC + Ninja) first; Linux later.

Goals

  • Implement each algorithm incrementally (baseline → improved → optimized).
  • Measure real performance & allocations with Tracy from day one.
  • Keep chapters self-contained for learning and CI-friendly.

Repo layout

chapters/01_arrays/     # first chapter (11 tasks)
cmake/                  # helper cmake modules
docs/                   # guides and report template
scripts/                # Windows/Linux helpers
third_party/tracy/      # profiler submodule (client + UI)

Quick start (Windows)

# 1) Add Tracy as a submodule (client + UI)
git submodule add https://github.com/wolfpld/tracy.git third_party/tracy

# 2) Configure (MSVC + Ninja, RelWithDebInfo, Tracy enabled)
scripts/win/configure.ps1

# 3) Build
scripts/win/build.ps1

# 4) Run Arrays harness (baseline create)
scripts/win/run_arrays.ps1 --algo=create --variant=baseline --n=1000000 --reps=3 --warmup

# 5) Launch Tracy UI (build UI in VS if prompted)
scripts/win/launch_tracy.ps1

Learning flow per task

  1. Implement a baseline version (clear & correct).
  2. Add Tracy zones and run a baseline capture.
  3. Apply one improvement, re-capture, and record deltas.
  4. Try an optimized variant (algorithmic or low-level).
  5. Write a short report using docs/REPORT_TEMPLATE.md.

Keep commits small: one change + one capture + a short note on results.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published