-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add gas-cost-bundles asset for benchmark improvement
- Loading branch information
1 parent
5d44f22
commit f9f9732
Showing
7 changed files
with
127 additions
and
103 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -12,6 +12,3 @@ gas_costs.txt | |
|
||
# Move Build Output | ||
build/ | ||
|
||
Calibration.move | ||
gen_smove_instr.sh |
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 @@ | ||
bundle* |
32 changes: 32 additions & 0 deletions
32
pallet/src/assets/move-projects/gas-costs-bundles/build.sh
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,32 @@ | ||
#!/bin/sh | ||
cd $(dirname $0) | ||
|
||
ITERATIONS=25 | ||
|
||
function write_module() { | ||
printf "module AiBob::CalMod$2 {\n" >> $1 | ||
printf " fun fun_fun(a: u8) {\n" >> $1 | ||
printf " assert!(a == 0, 0);\n" >> $1 | ||
printf " }\n" >> $1 | ||
printf "}\n" >> $1 | ||
} | ||
|
||
function create_move_project() { | ||
NAME=bundle$1 | ||
smove new $NAME | ||
TOML=$NAME/Move.toml | ||
printf 'AiBob = "5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty"' >> $TOML | ||
for i in $(seq 1 $1) | ||
do | ||
FILE=$NAME/sources/Modules.move | ||
write_module $FILE $i | ||
done | ||
sync | ||
smove bundle -p $NAME | ||
} | ||
|
||
rm -rf bundle* | ||
for i in $(seq 1 $ITERATIONS) | ||
do | ||
create_move_project $i | ||
done |
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,2 @@ | ||
gen_smove_instr.sh | ||
Calibration.move |
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
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
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