Commit 20b4bc77 authored by POTTIER Francois's avatar POTTIER Francois

A loop with several test sizes in speed.sh.

parent 7fddce25
......@@ -38,39 +38,46 @@ if $test_ocamlyacc; then
cp -RH $GENE/gene.native $GENE/gene.ocamlyacc
fi
# Dry run (measures the random generation time).
echo Dry run:
$TIME -f "%U" $GENE/gene.code --dry-run 2> $GENE/dry.time
cat $GENE/dry.time
# Run the code back-end.
echo Code back-end:
$TIME -f "%U" $GENE/gene.code > $GENE/code.out 2> $GENE/code.time
cat $GENE/code.time
# Run the table back-end.
echo Table back-end:
$TIME -f "%U" $GENE/gene.table > $GENE/table.out 2> $GENE/table.time
cat $GENE/table.time
# Avoid a gross mistake.
if ! diff -q $GENE/code.out $GENE/table.out ; then
echo CAUTION: the code and table back-ends disagree!
echo Code:
cat $GENE/code.out
echo Table:
cat $GENE/table.out
exit 1
fi
# (Optionally) Run the ocamlyacc parser.
if $test_ocamlyacc; then
echo ocamlyacc:
$TIME -f "%U" $GENE/gene.ocamlyacc > $GENE/ocamlyacc.out 2> $GENE/ocamlyacc.time
cat $GENE/ocamlyacc.time
fi
# Compute some statistics.
ocaml speed.ml
# A loop with several test sizes.
for size in 1000000 5000000 10000000 ; do
echo "Test size: $size"
# Dry run (measures the random generation time).
echo Dry run:
$TIME -f "%U" $GENE/gene.code --size $size --dry-run 2> $GENE/dry.time
cat $GENE/dry.time
# Run the code back-end.
echo Code back-end:
$TIME -f "%U" $GENE/gene.code --size $size > $GENE/code.out 2> $GENE/code.time
cat $GENE/code.time
# Run the table back-end.
echo Table back-end:
$TIME -f "%U" $GENE/gene.table --size $size > $GENE/table.out 2> $GENE/table.time
cat $GENE/table.time
# Avoid a gross mistake.
if ! diff -q $GENE/code.out $GENE/table.out ; then
echo CAUTION: the code and table back-ends disagree!
echo Code:
cat $GENE/code.out
echo Table:
cat $GENE/table.out
exit 1
fi
# (Optionally) Run the ocamlyacc parser.
if $test_ocamlyacc; then
echo ocamlyacc:
$TIME -f "%U" $GENE/gene.ocamlyacc --size $size > $GENE/ocamlyacc.out 2> $GENE/ocamlyacc.time
cat $GENE/ocamlyacc.time
fi
# Compute some statistics.
ocaml speed.ml
done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment