# Cairo Level 13: Performance

> Level 13: Performance of the LoWisa Cairo course: Execution and Storage Cost, Efficient Contract Patterns, Production Optimisation. 3 lessons and 9 ideas, each explained in one line.

Performance is level 13 of 14 of the [LoWisa Cairo course](/courses/cairo/). It has 3 lessons and 9 ideas. Below is every lesson and what it teaches, in one line each.

## Execution and Storage Cost

- **Step budgets.** Functions cost **steps**: measured by the runner, budgeted like gas.
- **Builtin usage.** Hashes and range checks spend **builtins**: counted and optimised where hot.
- **Storage economics.** Storage writes carry L1 **data** costs: lean state is the fee lever.

## Efficient Contract Patterns

- **Batch and pack.** **Batching** amortises overhead; packed storage trims data costs: measured trade-offs.
- **Off-chain with proofs.** Heavy computation moves **off-chain** under proofs: the chain verifies, never re-computes.
- **Event-based history.** History lives in **events**: indexers reconstructing state cheaply off-chain.

## Production Optimisation

- **Profile the runner.** Optimisation starts from runner **reports**: steps per entry point, tracked per commit.
- **Readability guard again.** An optimisation obscuring an **invariant** is a loss: audits cost more than steps.
- **Benchmark per upgrade.** Compiler and network upgrades shift costs: **re-measure** per release, assume nothing.

## Before and after this level

- **Before:** [Level 12: Proof-Oriented Execution](/courses/cairo/level-12-proof-oriented-execution/): Sierra and CASM Concepts, Provable Computation, Understanding Cairo's Unique Runtime.
- **Next:** [Level 14: Cairo Mastery](/courses/cairo/level-14-cairo-mastery/): Advanced Starknet Architecture, Security and Proof Trade-Offs, Reading and Improving Complex Cairo.

In the app each of these ideas is taught and then asked back, and the level ends with a checkpoint and flashcards. See [Checkpoints and flashcards](/help/checkpoints-and-flashcards/).

## Frequently asked questions

### What does Cairo Level 13: Performance cover?

Execution and Storage Cost, Efficient Contract Patterns, Production Optimisation: 3 lessons and 9 ideas.

### What should I know before this level?

The level before it, Level 12: Proof-Oriented Execution, which covers Sierra and CASM Concepts, Provable Computation, Understanding Cairo's Unique Runtime.

## Learn Cairo on your phone

The first level is free. LoWisa is on Google Play and the App Store.

---

Source: https://lowisa.dev/courses/cairo/level-13-performance/ · Updated 2026-11-30
