Skip to content

Conversation

cavemanloverboy
Copy link
Contributor

@cavemanloverboy cavemanloverboy commented Aug 21, 2025

Problem

It is possible to reduce CU consumption in the transfer instruction by using hints to the compiler, which allow it to optimize the code for the likely (hot) path.

Solution

This PR adds compiler hints to the transfer instruction.

@febo febo requested a review from joncinque August 22, 2025 09:58
cavemanloverboy and others added 3 commits August 22, 2025 03:27
Co-authored-by: Fernando Otero <[email protected]>
Co-authored-by: Fernando Otero <[email protected]>
Copy link
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great to me! Just some small nits. Have the CU savings been measured?

@cavemanloverboy
Copy link
Contributor Author

This looks great to me! Just some small nits. Have the CU savings been measured?

yea a bit over 10% less cus on transfer

Copy link
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me, thanks!

Edit: @febo I'll leave the final approval + merge to you though

Copy link
Contributor

@febo febo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks!

@febo febo merged commit 3cfb37d into solana-program:main Aug 26, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants