-
Notifications
You must be signed in to change notification settings - Fork 248
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
2,248 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
set term png size 1200,800; | ||
set output FILEOUT; | ||
unset key; | ||
set title NAME; | ||
set logscale x; | ||
set xlabel "Base Bytecode Size (Log)"; | ||
set ylabel "Alt Bytecode Ratio"; | ||
|
||
plot FILEIN using 2:4 with points; |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
set -eu | ||
|
||
IN1=$1 | ||
IN2=$2 | ||
|
||
jq --slurp -c ' | ||
. as $top | | ||
($top[] | select(.encoding == "base") | .data[]) as $base | | ||
($top[] | select(.encoding == "alt") | .data[] | select(.name == $base.name)) as $alt | | ||
{ | ||
name: $base.name, | ||
base_size: $base.bytecode_size, | ||
alt_size: $alt.bytecode_size, | ||
ratio: ($alt.bytecode_size / $base.bytecode_size) | ||
} | ||
' \ | ||
<(cat $IN1 | jq --slurp '{encoding: "base", data: .}') \ | ||
<(cat $IN2 | jq --slurp '{encoding: "alt", data: .}') \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env bash | ||
set -eu | ||
|
||
IN=$1 | ||
NAME=$(basename $IN .jsonl) | ||
DAT=$(dirname $IN)/$NAME.dat | ||
PNG=$(dirname $IN)/$NAME.png | ||
PLT=$(dirname $0)/bytecode-size-scatter.plt | ||
|
||
cat $IN | jq -r '[.name, .base_size, .alt_size, .ratio] | @tsv' > $DAT | ||
|
||
gnuplot \ | ||
-e "NAME='$(echo $NAME | tr _ - )'" \ | ||
-e "FILEIN='$DAT'" \ | ||
-e "FILEOUT='$PNG'" \ | ||
$PLT | ||
|
||
rm $DAT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env bash | ||
set -eu | ||
|
||
OUT=${1:-bytecode-size.jsonl} | ||
rm -f $OUT | ||
|
||
for file in aztec-packages/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 | ||
done | ||
|
||
for file in aztec-packages/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 | ||
done |