Ticket #8095: timing.sh

File timing.sh, 662 bytes (added by mbieleck, 19 months ago)

Timing script for Types.hs. Requires fomit-type-family-coercions.patch.

Line 
1#!/bin/bash
2
3[ -z "$GHC" ] && GHC=inplace/bin/ghc-stage2
4
5echo "GHC=$GHC"
6
7run_one() {
8        n="$1"
9        GHC_OPTIONS="$2"
10        fam_test="$3"
11        ./Types $n $fam_test a > test.hs && (time $GHC $GHC_OPTIONS test.hs -freduction-depth=5000) 2>&1 \
12                | grep real \
13                | while read _ time; do
14                        echo $time
15                  done
16}
17
18printf "%5s %10s %10s %10s %10s\n" N old omit old_tail omit_tail
19for n in 200 400 600 800 1000 1200 1400 1600 1800 2000; do
20        printf "%5s %10s %10s %10s %10s\n" $n \
21                $(run_one $n "" a) \
22                $(run_one $n "-fomit-type-family-coercions" a) \
23                $(if [ $n -lt 800 ]; then run_one $n "" b; else echo "timeout"; fi) \
24                $(run_one $n "-fomit-type-family-coercions" b)
25
26done