Skip to content

Instantly share code, notes, and snippets.

@jc00ke
Created November 5, 2012 18:56
Show Gist options
  • Save jc00ke/4019576 to your computer and use it in GitHub Desktop.
Save jc00ke/4019576 to your computer and use it in GitHub Desktop.
[Update] Schooled on benchmarking
#!/bin/bash
rbx_output="rbx-startup.csv"
rbx_int_output="rbx-int-startup.csv"
combined_output="rbx-combined.csv"
rm $combined_output $rbx_output $rbx_int_output
for i in {1..100}
do
/usr/bin/time -a -o $rbx_output -f "%e" -- rbx -e ''
done
for i in {1..100}
do
/usr/bin/time -a -o $rbx_int_output -f "%e" -- rbx -Xint -e ''
done
file_line_number=$(wc -l $rbx_output | awk '{print $1}')
echo "normal,-Xint,,sd normal,sd -Xint" >> $combined_output
for((i=1;i<=$file_line_number;i=i+1))
do
line_1=$(head -$i $rbx_output | tail -1 | tr "\n" ",")
line_2=$(head -$i $rbx_int_output | tail -1)
echo $line_1$line_2 >> $combined_output
done
∴ time rbx -e 'puts 1'
1
real 0m0.831s
user 0m0.444s
sys 0m0.140s
10:55:10 jesse@chino:~ rbx-head
∴ time rbx -Xint -e 'puts 1'
1
real 0m0.444s
user 0m0.416s
sys 0m0.024s
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
normal -Xint
0.45 0.47
0.44 0.44
0.45 0.43 mean normal 0.4315
0.46 0.43 sd normal 0.0116666667
0.43 0.43
0.44 0.46 mean -Xint 0.4477
0.43 0.43 sd -Xint 0.0246123481
0.44 0.44
0.43 0.47
0.43 0.44
0.42 0.46
0.42 0.45
0.44 0.43
0.43 0.46
0.49 0.46
0.42 0.45
0.44 0.42
0.43 0.43
0.43 0.43
0.44 0.43
0.43 0.44
0.43 0.48
0.44 0.5
0.44 0.49
0.42 0.43
0.43 0.43
0.44 0.44
0.44 0.44
0.43 0.47
0.43 0.43
0.43 0.46
0.43 0.42
0.43 0.43
0.42 0.45
0.43 0.44
0.45 0.43
0.44 0.43
0.43 0.48
0.44 0.53
0.43 0.55
0.44 0.47
0.43 0.48
0.43 0.49
0.44 0.47
0.43 0.45
0.44 0.44
0.43 0.45
0.43 0.44
0.42 0.45
0.44 0.44
0.43 0.47
0.44 0.43
0.47 0.45
0.46 0.43
0.44 0.45
0.44 0.44
0.43 0.44
0.42 0.51
0.42 0.51
0.43 0.53
0.43 0.45
0.43 0.43
0.43 0.43
0.43 0.44
0.42 0.45
0.42 0.44
0.44 0.43
0.42 0.43
0.43 0.43
0.42 0.43
0.43 0.44
0.42 0.43
0.42 0.45
0.43 0.44
0.43 0.43
0.43 0.43
0.42 0.44
0.42 0.43
0.42 0.47
0.42 0.44
0.42 0.44
0.42 0.43
0.42 0.43
0.42 0.44
0.42 0.44
0.42 0.44
0.42 0.43
0.42 0.44
0.45 0.43
0.43 0.44
0.43 0.43
0.42 0.43
0.43 0.44
0.42 0.43
0.43 0.46
0.42 0.45
0.43 0.43
0.42 0.43
0.43 0.43
0.44 0.45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment