Earn 5.76% APY staking with Solana Compass + help grow Solana's ecosystem

Stake natively or with our LST compassSOL to earn a market leading APY

Conference Talk Accelerate 25

Scale or Die at Accelerate 2025: Writing Optimized Solana Programs

Solana 🧭 Compass By Solana 🧭 Compass May 20, 2025 7 min read

Learn advanced Solana program optimization techniques to boost efficiency and reduce costs

The notes below are AI generated and may not be 100% accurate. Watch the video to be sure!

Dean Little, a prominent figure in the Solana ecosystem, delivered a groundbreaking presentation on writing optimized Solana programs at Accelerate 2025. His insights promise to revolutionize how developers approach efficiency and cost-effectiveness in Solana smart contract development.

Summary

Dean Little's presentation at Accelerate 2025 focused on the critical aspects of optimizing Solana programs. He emphasized three main points: compute efficiency, storage optimization, and data minimization. The talk highlighted the importance of balancing these factors to achieve capital efficiency while considering practical constraints such as development timelines and maintainability.

Little provided a comprehensive overview of various optimization techniques, ranging from high-level framework choices to low-level assembly coding. He demonstrated how even small changes could lead to significant improvements in compute unit (CU) consumption and program size, ultimately resulting in cost savings and improved performance for Solana applications.

The presentation included live coding demonstrations, showcasing the potential for extreme optimization using assembly language. Little also introduced tools and resources developed by his team at Blueshift, aimed at making advanced optimization techniques more accessible to Solana developers.

Key Points:

Philosophy of Program Optimization

Dean Little outlined the three pillars of Solana program optimization: compute, storage, and data. He explained that optimizing compute units leads to higher transaction priority for the same fee, potentially saving users money on priority fees. Storage optimization reduces the on-chain footprint, lowering operational costs and freeing up SOL for other uses like staking. Data optimization focuses on minimizing instruction data and account usage, making programs more composable and easier to integrate with other protocols.

Little emphasized that optimization is fundamentally about capital efficiency - saving or not wasting money. However, he also noted that extreme optimization isn't always the most capital-efficient approach, as it can lead to increased development costs, longer audit times, and potential maintenance issues. The key is finding the right balance for each project's specific needs and constraints.

Compute Unit (CU) Optimization Techniques

Little shared several practical tips for reducing CU consumption in Solana programs. He advised against using the Solana Program library due to its inefficiencies, recommending alternative libraries developed by community contributors. He also highlighted the importance of using zero-copy deserialization techniques, which can significantly reduce computational overhead.

Another key recommendation was to prioritize fixed-size data in account structures. This not only improves deserialization efficiency but also enables easier RPC filtering. Little also advised against including unnecessary accounts in the accounts array and discouraged recomputing PDA signers when not required, as these practices can lead to unnecessary CU consumption.

Real-world Optimization Examples

The presentation included a step-by-step demonstration of optimizing a simple "Hello World" program. Little started with a basic Anchor implementation and progressively optimized it using various techniques. He showed how disabling certain Anchor features, hand-rolling account contexts, and ultimately switching to the Pinocchio framework could dramatically reduce CU consumption.

In a particularly impressive demonstration, Little live-coded an assembly language version of the program, achieving even further CU reductions. He used a custom tool (SPPF) to generate memory offsets and showcased advanced techniques like using the return register for input validation. The assembly version not only consumed fewer CUs but also resulted in a significantly smaller program size.

Tools and Resources for Optimization

Little introduced several tools and resources to aid developers in optimization efforts. He demonstrated the use of SPPF, a tool for quickly scaffolding and testing Solana programs. He also showcased an online application (SPPF.xyz) that generates memory offsets for different account structures, simplifying the process of working with low-level memory layouts.

The presentation concluded with an announcement about Blueshift, Little's project aimed at open-sourcing content and tools for advanced program optimization. This initiative promises to make cutting-edge optimization techniques more accessible to the broader Solana developer community.

Facts + Figures

  • Optimizing Solana programs can lead to lower fees for users and reduced operational costs for protocols
  • Using zero-copy deserialization can significantly reduce computational overhead
  • Switching from Anchor to Pinocchio framework reduced CU consumption from 649 to 109 in the demonstrated example
  • Assembly language optimization further reduced CU consumption to 104, beating even the Pinocchio implementation
  • Program size was reduced from 76 kilobytes (Anchor) to under 1 kilobyte (optimized assembly)
  • The custom linker file reduced the optimized program size from 1,040 bytes to 928 bytes
  • Blueshift, Dean Little's project, aims to open-source content for advanced program optimization
  • SPPF.xyz is a tool that generates memory offsets for different account structures
  • Solana Program library was cited as inefficient compared to community-developed alternatives
  • Using SHA-256 instead of create_program_address for PDA checks can save 20 CUs (100 CUs vs 120 CUs)

Top quotes

  1. "Optimization is actually not always capital efficient."
  2. "Try to learn how to use zero copy. Now, this is something that works with Pinocchio, Steel, Anchor, whatever framework you're using."
  3. "Always try to put fixed size data first."
  4. "Don't include accounts in your accounts array just to get its PubKey."
  5. "Skip superfluous checks."
  6. "Optimization doesn't have to lead to bad UX. Libraries are getting much better."
  7. "This is what we call extreme optimization."
  8. "It's really about what's the best tool for the job."

Questions Answered

What are the three main aspects of Solana program optimization?

The three main aspects of Solana program optimization are compute, storage, and data. Compute optimization focuses on reducing CU consumption to improve transaction priority and reduce fees. Storage optimization aims to minimize the on-chain footprint, lowering operational costs. Data optimization involves reducing instruction data and account usage to improve composability and integration with other protocols.

How can developers reduce Compute Unit (CU) consumption in Solana programs?

Developers can reduce CU consumption by avoiding inefficient libraries like Solana Program, using zero-copy deserialization techniques, prioritizing fixed-size data in account structures, avoiding unnecessary account inclusions, and skipping superfluous checks. Additionally, using more efficient frameworks like Pinocchio or even writing assembly code can lead to significant CU savings.

What is the benefit of putting fixed-size data first in account structures?

Putting fixed-size data first in account structures improves deserialization efficiency and enables easier RPC filtering. This is because the offsets for fixed-size data are known in advance, allowing for more efficient access and filtering operations without having to process variable-length data first.

How does extreme optimization compare to using high-level frameworks in terms of CU consumption?

Extreme optimization techniques, such as writing assembly code, can lead to significant reductions in CU consumption compared to high-level frameworks. In the example demonstrated, an assembly implementation consumed 104 CUs, compared to 108 CUs for Pinocchio and 649 CUs for a basic Anchor implementation. However, this level of optimization requires more specialized knowledge and can be more challenging to maintain.

What is Blueshift and how does it aim to help Solana developers?

Blueshift is a project led by Dean Little that aims to open-source content and tools for advanced program optimization in Solana. It provides resources and techniques to help developers implement cutting-edge optimization strategies, making these advanced methods more accessible to the broader Solana developer community.

What is SPPF and how does it assist in Solana program development?

SPPF (Solana Program Project Framework) is a tool developed to assist in Solana program development. It helps quickly scaffold projects and includes features for testing and building Solana programs. Additionally, the SPPF.xyz website provides a utility for generating memory offsets for different account structures, simplifying the process of working with low-level memory layouts in Solana programs.

How does program size optimization impact Solana development?

Program size optimization can significantly reduce the amount of rent (in SOL) required to keep a program on-chain. In the example given, optimizing from a 76 kilobyte Anchor program to a sub-1 kilobyte assembly program not only reduces ongoing costs but also enables deploying the entire program in nearly a single transaction, improving deployment efficiency.

What are some considerations when deciding how much to optimize a Solana program?

When deciding on the level of optimization for a Solana program, developers should consider factors such as development time, maintainability, audit requirements, and the specific needs of the project. While extreme optimization can lead to significant performance improvements and cost savings, it may also increase development complexity and make future updates more challenging. The key is to find the right balance for each project's specific requirements and constraints.



Comments

Please login to leave a comment.

Related Content

Solana Changelog - Mar 19: Anza's Agave Client, Compute, and create-solana-program

Explore Solana's latest developments: Anza's Agave client, block space challenges, priority fees, and new developer tools like create-solana-program.

Scale or Die 2025: No-strings-attached programs w/ Pinocchio

Discover how Pinocchio is revolutionizing Solana program development with improved efficiency and performance

Solana Changelog - Test validator fix, new Syscall, RPC updates, and more

Dive into the latest Solana improvements including a test validator fix, new GetEpochStake syscall, RPC updates for interest-bearing tokens, and continued Core BPF migration progress.

Solana Changelog - Test validator fix, new Syscall, RPC updates, and more

Dive into the latest Solana updates including test validator improvements, a new Syscall for on-chain governance, RPC enhancements for interest-bearing tokens, and continued progress on Core BPF migration.

Solana Changelog - Agave Client, Compute Optimization, and Create-Solana-Program

Explore Solana's latest developments including the Agave validator client, compute optimization strategies, and new tools like Create-Solana-Program in this comprehensive changelog.

Solana Changelog - Faster getProgramAccounts, SIMD-96 Approved, and Anchor Types in Kinobi

Discover the latest Solana updates including optimized getProgramAccounts, SIMD-96 approval for validator rewards, and new Anchor type support in Kinobi

Solana Changelog Sep 4 - Rust Wallet Adapter, Optimized Entrypoint, and Anchor improvements

Explore the latest Solana updates including the Radar Hackathon, RPC 2.0 transition guide, and performance improvements for developers.

Why JUP Is Solana's Most Anticipated Airdrop | Mert Mumtaz, Garrett Harper

Explore Jupiter's groundbreaking airdrop, Solana's ecosystem developments, and the future of decentralized finance in this in-depth analysis.

Solana Changelog Aug 21 - SIMD Updates, Commits, and Developer Resources

Discover the latest Solana updates, including SIMD-0163, new commits, and exciting developer resources like Luzid in this week's Solana Changelog.

Solana Changelog Jun 5 - Faster getProgramAccounts, SIMD-96 approved, and Anchor types in Kinobi

Discover the latest Solana improvements including faster getProgramAccounts, SIMD-96 approval for validator rewards, and Kinobi's support for Anchor types

Solana Changelog Jun 19 - Test validator fix, new Syscall, RPC updates, and more

Exciting Solana developments: test validator improvements, new GetEpochStake syscall, RPC updates for interest-bearing tokens, and continued Core BPF program migration.

Solana Changelog - October 11, 2022 - Vote Credit Proposal, Curve 25519 Compute Costs, & Seahorse v2

Discover the latest Solana developments including a new vote credit proposal, optimized Curve 25519 compute costs, and the exciting release of Seahorse v2 for Python developers.

Solana Changelog - Faster getProgramAccounts, SIMD-96 Approved, and Anchor Types in Kinobi

Discover the latest Solana updates including optimized getProgramAccounts, SIMD-96 approval for full validator priority fees, and new Anchor type support in Kinobi. Learn about recent commits, documentation updates, and community resources.

Solana Changelog - Feb 27 - Partitioned Epoch Rewards, Anchor CI, and 2.0

Dive into the latest Solana developments, including SIMD-0118 for partitioned epoch rewards, Anchor CI enhancements, and the path to Solana 2.0. Learn about optimizations, new features, and community initiatives shaping the future of Solana.

Solana Changelog - December 5 - Geyser, GroupMember Extension, and Core BPF Programs

Explore the latest Solana updates including Geyser plugin logging, new token extensions, and improvements to core BPF programs. Learn about the impact on developers and the ecosystem.

Solana tokens

Solana Token Markets

Explore all tokens →