Introduce a dedicated performance section documenting escape hatches and optimization patterns available to developers who need to go beyond the default Anchor abstractions.
Content to include:
- Custom entrypoint with discriminator-based dispatch (as shown in the design doc) that falls back to the Anchor
entry function.
- When and how to use raw
AccountView access instead of typed Account<T> for hot paths.
- Zero-copy layout best practices: alignment, padding,
repr(C) rules.
- Benchmarking methodology (CU usage, LiteSVM-based benchmarks).
- Trade-offs: what safety guarantees you give up with each escape hatch.
Acceptance criteria:
The Anchor documentation has a "Performance" section with runnable code examples and CU comparisons.
Introduce a dedicated performance section documenting escape hatches and optimization patterns available to developers who need to go beyond the default Anchor abstractions.
Content to include:
entryfunction.AccountViewaccess instead of typedAccount<T>for hot paths.repr(C)rules.Acceptance criteria:
The Anchor documentation has a "Performance" section with runnable code examples and CU comparisons.