Idiomatic Mojo Habits
Write code that is fast by default.
Fast by Default
The best speed comes from habits, not last-minute tricks. Idiomatic Mojo is written so it is fast from the very first draft. 🚀
Prefer fn in Hot Paths
Reach for fn in code that runs often. Its required types let the compiler optimize the parts of your program that matter most.
fn dot(a: Int, b: Int) -> Int:
return a * bAll lessons in this course
- Writing a Fair Benchmark
- Why fn and Types Speed Up
- Reading the Numbers Honestly
- Idiomatic Mojo Habits