OLD | NEW |
---|---|
(Empty) | |
1 testdir=$(dirname $0) | |
kustermann
2017/02/01 13:00:55
add
#!/bin/sh
and chmod +x ?
asgerf
2017/02/02 12:30:27
Done.
| |
2 first_input=10 | |
3 first_output=$(mktemp) | |
4 dart --print-metrics $testdir/ast_membench.dart $1 $first_input >/dev/null 2>$fi rst_output | |
5 second_input=20 | |
6 second_output=$(mktemp) | |
7 dart --print-metrics $testdir/ast_membench.dart $1 $second_input >/dev/null 2>$s econd_output | |
8 | |
9 bytes1=$(fgrep 'heap.old.used.max' $first_output | head -n1 | cut -d' ' -f4) | |
10 bytes2=$(fgrep 'heap.old.used.max' $second_output | head -n1 | cut -d' ' -f4) | |
11 | |
12 bytes=$(echo "($bytes2 - $bytes1)/($second_input - $first_input)" | bc) | |
13 mega_bytes=$(echo "$bytes / 1000000" | bc) | |
14 printf "Memory usage = %d B (%2.2f MB)" $bytes $mega_bytes | |
15 echo | |
kustermann
2017/02/01 13:00:55
remove first_output/second_output again
asgerf
2017/02/02 12:30:27
Done.
| |
OLD | NEW |