Skip to content

feat(tools): add cli to measure decorator size in masp package#1015

Open
mooori wants to merge 1 commit intonextfrom
mooori/objsize-decorators
Open

feat(tools): add cli to measure decorator size in masp package#1015
mooori wants to merge 1 commit intonextfrom
mooori/objsize-decorators

Conversation

@mooori
Copy link
Contributor

@mooori mooori commented Mar 18, 2026

Context: #1013

Currently cargo miden build will always include the debug info most relevant for this kind of analysis. So as first step this PR adds tooling to strip decorators from a MastForest and report the resulting size change.

Here's an example of how to use the tool and the output it produces:

# Assumes `examples/basic-wallet` was built in release mode
# Can be pointed at any `.masp` file
> cargo run -p objsize -- decorators examples/basic-wallet/target/miden/release/basic_wallet.masp

Input: examples/basic-wallet/target/miden/release/basic_wallet.masp
Package kind: library
Artifact: library

Metric                 KB   Delta  Delta %
original masp       36.65       -        -
original forest     36.13    0.00   +0.00%
without decorators  17.95  -18.19  -50.33%
compacted forest    13.10  -23.03  -63.74%

Users who wish to run it on their own masp packages may want to build the binary and add it to their path.

@mooori mooori force-pushed the mooori/objsize-decorators branch from 5572792 to 4cc7067 Compare March 18, 2026 16:01
@mooori mooori marked this pull request as ready for review March 18, 2026 16:28
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