Scale or Die at Accelerate 2025: Writing Optimized Solana Programs
By accelerate-25
Published on 2025-05-20
Dean Little from Blueshift delivers an in-depth exploration of Solana program optimization techniques at Accelerate 2025.
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
- "Optimization is actually not always capital efficient."
- "Try to learn how to use zero copy. Now, this is something that works with Pinocchio, Steel, Anchor, whatever framework you're using."
- "Always try to put fixed size data first."
- "Don't include accounts in your accounts array just to get its PubKey."
- "Skip superfluous checks."
- "Optimization doesn't have to lead to bad UX. Libraries are getting much better."
- "This is what we call extreme optimization."
- "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.
On this page
- Summary
- Key Points:
- Facts + Figures
- Top quotes
-
Questions Answered
- What are the three main aspects of Solana program optimization?
- How can developers reduce Compute Unit (CU) consumption in Solana programs?
- What is the benefit of putting fixed-size data first in account structures?
- How does extreme optimization compare to using high-level frameworks in terms of CU consumption?
- What is Blueshift and how does it aim to help Solana developers?
- What is SPPF and how does it assist in Solana program development?
- How does program size optimization impact Solana development?
- What are some considerations when deciding how much to optimize a Solana program?
Related Content
Scale or Die at Accelerate 2025: Decompiling Solana Programs
Robert Chen from Ottersec unveils groundbreaking tools for decompiling Solana programs, enhancing transparency and security in the ecosystem.
Ship or Die at Accelerate 2025: Verifying Dogecoin on Solana
Carter Feldman of Psy Protocol unveils a groundbreaking bridge between Dogecoin and Solana, enabling seamless integration and new utility for DOGE holders.
Ship or Die at Accelerate 2025: Building User-Centric Products
Simon Amor of Sling Money shares invaluable insights on creating user-centric products in the blockchain space
Ship or Die at Accelerate 2025: Lightning Talk: SendAI
SendAI introduces Solana App Kit, revolutionizing mobile app development on Solana
Ship or Die at Accelerate 2025: Hello and Welcome
Solana hosts its first major US conference, focusing on policy, product development, and the future of crypto in America.
Scale or Die at Accelerate 2025: The State of Solana MEV
An in-depth look at MEV on Solana, focusing on sandwich attacks and their impact on the ecosystem
Ship or Die at Accelerate 2025: Kalshi CEO on Prediction Markets and Crypto
Kalshi CEO Tarek Mansour discusses the company's journey, regulatory challenges, and expansion into crypto at Accelerate 2025.
Ship or Die at Accelerate 2025: Lightning Talk: MetaMask
MetaMask announces native Solana support and multi-chain wallet experience
Ship or Die at Accelerate 2025: Jason Urban, Michael Hubbard, Robert Leshner
Industry leaders discuss the future of equities trading on Solana blockchain at Accelerate 2025 conference
Breakpoint 2023: ZK on Solana: Private Solana Programs
An exploration of zero-knowledge proofs for enhanced privacy on the Solana blockchain.
Scale or Die 2025: No-strings-attached programs w/ Pinocchio
Fernando Otero introduces Pinocchio, a new dependency-free SDK for writing efficient Solana programs
Breakpoint 2023: Fuzzing, Formal Methods, and the State of Solana Security
An exploration of how fuzzing and formal verification techniques contribute to the security of the Solana blockchain.
Scale or Die at Accelerate 2025: Welcome to Scale or Die: Day 2
Day 2 of Scale or Die event focuses on infrastructure and dev tooling with workshops and summits
Ship or Die at Accelerate 2025: Lightning Talk: Sanctum
FP Lee from Sanctum exposes unethical practices in crypto and calls for greater transparency in the industry
Breakpoint 2023: Program Runtime v2
The latest updates on Solana's Program Runtime v2 aim to enhance efficiency, composability, and ease of use for developers.
- Borrow / Lend
- Liquidity Pools
- Token Swaps & Trading
- Yield Farming
- Solana Explained
- Is Solana an Ethereum killer?
- Transaction Fees
- Why Is Solana Going Up?
- Solana's History
- What makes Solana Unique?
- What Is Solana?
- How To Buy Solana
- Solana's Best Projects: Dapps, Defi & NFTs
- Choosing The Best Solana Validator
- Staking Rewards Calculator
- Liquid Staking
- Can You Mine Solana?
- Solana Staking Pools
- Stake with us
- How To Unstake Solana
- How validators earn
- Best Wallets For Solana