This repository has been archived by the owner on Jan 10, 2025. It is now read-only.
New program: serialization library study #3161
Labels
stale
[bot only] Added to stale content; will be closed soon
Problem
There's mostly anecdotal data about the tradeoffs of different serialization techniques used by on-chain programs. The typically used ones are:
Pack
by hand, as intoken
unsafe
pointer castsBorsh
, as ingovernance
andstake-pool
, among othersbytemuck
, as in certaintoken-2022
extensionsbincode
, not used in BPF programs, but builtin programs in the monorepo use it, such asstake
protobuf
, a bit more overheadSolution
Add in a new
libraries/serialization
style program that compares these different approaches. #3064 was the most bare-bones prototype possible that can be used for inspiration. Some features to compare them on would be:bincode
is known to have high compute usage)borsh
is known to make a compiled program huge)bytemuck
only allows for types that can be represented as bytes)The text was updated successfully, but these errors were encountered: