Skip to content

include onchain measurements and benchs - #1

Merged
crypt0miester merged 2 commits into
mainfrom
onchain
Aug 22, 2026
Merged

include onchain measurements and benchs#1
crypt0miester merged 2 commits into
mainfrom
onchain

Conversation

@crypt0miester

Copy link
Copy Markdown
Contributor

solana programs can already link this crate, since the portable path compiles for SBF with default features. this PR makes that path cheap to carry and puts numbers behind it.

CU per call, mollusk 0.15 on the agave 4.2 runtime, platform-tools v1.54.

tape five8 bs58
encode_32 744 1,231 9,520
decode_32 770 1,609 7,658
encode_64 1,741 3,015 35,704
decode_64 2,382 4,589 27,814

for scale, a pubkey encode or decode costs less than half of one create_program_address syscall (1,584 CU). The syscall does no base58, it is only a familiar unit of budget.

notes:

  • the variable feature stays off in programs. it overflows the 4 KB SBF stack frame and its tables are 420 KB
  • one runtime build measured. CU prices are protocol constants and they move across major Agave releases

@crypt0miester
crypt0miester merged commit 0d495d1 into main Aug 22, 2026
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