Skip to content

Instantly share code, notes, and snippets.

@rgrig
Created February 6, 2011 18:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rgrig/813603 to your computer and use it in GitHub Desktop.
Save rgrig/813603 to your computer and use it in GitHub Desktop.
solution time [s] memory [bytes]
peter.hs .163 7479296
radu.hs .160 7495680
duncan.hs 176.97 7467008
tim.hs .160 7471104 Files out and out.ref differ
nicolas.lhs .460 19001344 Files out and out.ref differ
lennart.hs 2134.98 7467008 Files out and out.ref differ
This was run in /dev/shm (that is, not using the HDD) on a computer with two cores at 4788 bogomips each (Intel i3 @2.4GHz), and 4GB of RAM.
Script used (rather ugly):
#!/bin/bash
N=100 # N=5 for duncan.hs and lennart.hs
ghc --make -O -fforce-recomp $1 -o ride 2> /dev/null
strip ride
T=0
for i in `seq 1 $N`; do
/usr/bin/time -f '%e' ./ride < C-large-practice.in > out 2> t
T=$(echo "$T+$(cat t)" | bc -l)
done
T=$(echo "scale=3; $T / $N" | bc -l)
R=$(diff -q out out.ref)
valgrind --tool=massif --pages-as-heap=yes --massif-out-file=mem ./ride < C-large-practice.in > out 2> /dev/null
M=$(grep mem_heap_B= mem | awk -F '=' '{if (n < $2) n=$2} END{print n}')
echo $1 $T $M $R
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment