Skip to content

Commit

Permalink
Adding a shell script that runs either all scripts in the current dir…
Browse files Browse the repository at this point in the history
…ectory or one script (specified on the command line) under ruby and rubinius and tells you in a tab separated list how long each took.
  • Loading branch information
Graham committed May 21, 2007
1 parent b28b77a commit 490ed81
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions benchmark/yarv/runboth.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
TIME="%e"
CMD1=ruby
CMD2=rbx
ulimit -v 262144
ulimit -s 32768

FILES=bm_*.rb
if [ "$1x" != "x" ]; then
FILES=$1
fi

echo "Test $CMD1 $CMD2"
for FILE in $FILES
do
BASE=`echo $FILE | awk -F '.' '{ print $1 }'`
RUBYTIME=`/usr/bin/time -f "$TIME" sh -c "ruby $FILE > $FILE.out.ruby" 2>&1`
if [ $? != 0 ]; then
RUBYTIME='Error'
fi
RBXTIME=`/usr/bin/time -f "$TIME" sh -c "rbx $FILE > $FILE.out.rbx" 2>&1`
if [ $? != 0 ]; then
RBXTIME='Error'
fi
echo "$BASE $RUBYTIME $RBXTIME"
done

0 comments on commit 490ed81

Please sign in to comment.