File tree 2 files changed +19
-13
lines changed
2 files changed +19
-13
lines changed Original file line number Diff line number Diff line change
1
+ * .bin
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
- COMPILE=" mojo build *.mojo"
3
- BENCH=" hyperfine -N -w 10 "
2
+ BENCH=" hyperfine -i -N -w 10 "
4
3
5
4
for dir in * ; do
6
- if [ -d " $dir " ]; then
7
- COMMANDS=(" python ${dir} .py" )
8
- COMMANDS+=($dir )
9
- cd " $dir "
10
- echo
11
- echo " Benchmarking $dir "
12
- echo " ======================"
13
- $COMPILE
14
- $BENCH " ${COMMANDS[@]} "
15
- cd ..
16
- fi
5
+ if [ -d " $dir " ]; then
6
+ # Compile command with the name
7
+ COMPILE=" mojo build ${dir} .mojo -o ${dir} .bin"
8
+ # Generate commands to run
9
+ COMMANDS=(" python ${dir} .py" )
10
+ COMMANDS+=(" mojo ${dir} .mojo" )
11
+ COMMANDS+=(${dir} .bin)
12
+ cd " $dir "
13
+ echo
14
+ echo " Benchmarking $dir "
15
+ echo " ======================"
16
+ # Compile mojo first
17
+ $COMPILE
18
+ # Run Benchmark with all the commands
19
+ $BENCH " ${COMMANDS[@]} "
20
+ cd ..
21
+ fi
17
22
done
You can’t perform that action at this time.
0 commit comments