0Pricing
Mojo Academy · Lesson

Optimizing What Matters

Apply fixes where they count.

Fix Only the Hot Path

Spend effort where the profiler points. Optimizing cold code wastes time and adds complexity for a speedup nobody will ever feel.

Reach for fn and Types

A strict fn with typed arguments lets Mojo compile tight, fast code. Swapping a hot def for fn is often the easiest big win.

fn dot(a: Float64, b: Float64) -> Float64:
    return a * b

All lessons in this course

  1. Timing and Benchmarking Tools
  2. Finding the Real Bottleneck
  3. Optimizing What Matters
  4. Reading a Profile Report
← Back to Mojo Academy