Courses

Optimizing Performance on Solana
Solana · Chapter 13

Optimizing Performance on Solana

Performance starts with doing less unnecessary work. Measure a working program before trying to make it faster.

The basics

  • Compute units measure execution work. Inspect transaction simulation or logs to understand usage.
  • Pass only needed accounts, and mark an account writable only when it must change.
  • A single shared writable account can become a bottleneck. Independent user accounts may allow more parallel activity, depending on your design.

Try it yourself

Compare a design where every journal update writes to one global account with one where each user has an entry account. Identify the shared write that could slow concurrent updates.

Read more in the official documentation

@ Daniel Burlacu