Skip to content

Commit

Permalink
Measure and display FlexBuffer sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
aakoshh committed Feb 25, 2025
1 parent 948cd8e commit 67e98a9
Show file tree
Hide file tree
Showing 6 changed files with 1,295 additions and 8 deletions.
645 changes: 645 additions & 0 deletions scripts/bytecode-sizes/bincode-vs-flexbuffers.jsonl

Large diffs are not rendered by default.

Binary file added scripts/bytecode-sizes/bincode-vs-flexbuffers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified scripts/bytecode-sizes/compare-bytecode-size.sh
100644 → 100755
Empty file.
645 changes: 645 additions & 0 deletions scripts/bytecode-sizes/flexbuffers.jsonl

Large diffs are not rendered by default.

Empty file modified scripts/bytecode-sizes/plot-bytecode-size.sh
100644 → 100755
Empty file.
13 changes: 5 additions & 8 deletions scripts/bytecode-sizes/print-bytecode-size.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
#!/usr/bin/env bash
set -eu

OUT=${1:-bytecode-size.jsonl}
rm -f $OUT
AZTEC_PACKAGES_DIR=$1

for file in aztec-packages/noir-projects/noir-protocol-circuits/target/*.json; do
for file in $AZTEC_PACKAGES_DIR/noir-projects/noir-protocol-circuits/target/*.json; do
PROGRAM=$(basename $file .json)
cat $file \
| jq --arg PROGRAM $PROGRAM \
-c '{name: $PROGRAM, bytecode_size: .bytecode | @base64d | length}' \
>> $OUT
-c '{name: $PROGRAM, bytecode_size: .bytecode | @base64d | length}'
done

for file in aztec-packages/noir-projects/noir-contracts/target/*.json; do
for file in $AZTEC_PACKAGES_DIR/noir-projects/noir-contracts/target/*.json; do
CONTRACT=$(basename $file .json)
cat $file \
| jq --arg CONTRACT $CONTRACT \
-c '.functions | sort_by(.name) | .[] | {name: ($CONTRACT + "::" + .name), "bytecode_size": .bytecode | @base64d | length}' \
>> $OUT
-c '.functions | sort_by(.name) | .[] | {name: ($CONTRACT + "::" + .name), "bytecode_size": .bytecode | @base64d | length}'
done

0 comments on commit 67e98a9

Please sign in to comment.