Skip to content

Optimize AccountMetaList#329

Open
palmerlao wants to merge 4 commits intosolana-foundation:mainfrom
palmerlao:main
Open

Optimize AccountMetaList#329
palmerlao wants to merge 4 commits intosolana-foundation:mainfrom
palmerlao:main

Conversation

@palmerlao
Copy link
Copy Markdown

@palmerlao palmerlao commented Jun 9, 2025

AccountMetaList calls IsWritable and IsSigner in a loop over GetAllKeys. IsWritable and IsSigner both have a loop over GetAllKeys too. I refactored logic from IsWritable and IsSigner using the account index and call that instead, since both of those functions already must have resolved the message's accounts.

I also changed the Message method receiver to a pointer to reduce copies of that struct, which I believe appear in the profile as duffcopy.

I reduced calls to numStaticAccounts (which evaluate NumLookups) and removed the MessageAddressTableLookup struct copies because I think those also contributed to the duffcopy node.

before:
image

after:
image

@palmerlao palmerlao changed the title Refactor uncheckedAccountIndexIsWritable Optimize AccountMetaList Jun 9, 2025
@palmerlao
Copy link
Copy Markdown
Author

@gagliardetto I can't seem to add you as a reviewer to this PR. Would you mind taking a look?

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.

1 participant