Permalink
Browse files

osh-parser benchmark: split host and shell into 2 columns: name and ID.

Also make note of things to add to the report.
  • Loading branch information...
Andy Chu
Andy Chu committed Oct 31, 2017
1 parent 8020646 commit 394b26099be01314f3a93645f725aac5033c1925
Showing with 43 additions and 21 deletions.
  1. +4 −4 benchmarks/id.sh
  2. +7 −0 benchmarks/osh-parser.R
  3. +32 −17 benchmarks/osh-parser.sh
View
@@ -137,8 +137,8 @@ publish-shell-id() {
# And use the commit hash or what?
hash=$(_shell-id-hash $src | md5sum) # not secure, an identifier
local id="$name-${hash:0:8}"
local dest="$dest_base/$id"
local id="${hash:0:8}"
local dest="$dest_base/$name-$id"
mkdir -p $dest
cp --no-target-directory --recursive $src/ $dest/
@@ -218,8 +218,8 @@ publish-platform-id() {
local hash
hash=$(_platform-id-hash $src | md5sum) # not secure, an identifier
local id="$name-${hash:0:8}"
local dest="$dest_base/$id"
local id="${hash:0:8}"
local dest="$dest_base/$name-$id"
mkdir -p $dest
cp --no-target-directory --recursive $src/ $dest/
View
@@ -48,6 +48,13 @@ main = function(argv) {
all_times = bind_rows(hosts)
print(all_times)
all_times %>% distinct(platform_id) -> distinct_hosts
print(distinct_hosts)
all_times %>% distinct(shell_id) -> distinct_shells
print(distinct_shells)
return()
# Summarize rates by platform/shell
all_times %>%
group_by(shell_id, platform_id) %>%
View
@@ -30,9 +30,10 @@ import-files() {
sh-one() {
local append_out=$1
local sh=$2
local platform_id=$3
local shell_id=$4
local path=$5
local host=$3
local host_id=$4
local shell_id=$5
local path=$6
echo "--- $sh $path ---"
# Can't use array because of set -u bug!!! Only fixed in bash
@@ -43,11 +44,12 @@ sh-one() {
extra_args='--ast-format none'
fi
# exit code, time in seconds, platform_id, shell_id, path. \0
# exit code, time in seconds, host_id, shell_id, path. \0
# would have been nice here!
benchmarks/time.py \
--output $append_out \
--field "$platform_id" --field "$shell_id" --field "$path" -- \
--field "$host" --field "$host_id" \
--field "$sh" --field "$shell_id" --field "$path" -- \
"$sh" -n $extra_args "$path" || echo FAILED
}
@@ -78,13 +80,15 @@ write-sorted-manifest() {
cat $csv
}
# runtime_id, platform_id, toolchain_id (which sometimes you don't know)
# runtime_id, host_id, toolchain_id (which sometimes you don't know)
run() {
local preview=${1:-}
local host
host=$(hostname)
local job_id
job_id="$(hostname).$(date +%Y-%m-%d__%H-%M-%S)"
job_id="$host.$(date +%Y-%m-%d__%H-%M-%S)"
local out_dir='../benchmark-data/osh-parser/'
local out="$out_dir/$job_id.times.csv"
@@ -98,16 +102,16 @@ run() {
local sorted=$SORTED
# Write Header of the CSV file that is appended to.
echo 'status,elapsed_secs,platform_id,shell_id,path' > $out
echo 'status,elapsed_secs,host,host_id,shell,shell_id,path' > $out
local tmp_dir=_tmp/platform-id/$(hostname)
local tmp_dir=_tmp/platform-id/$host
benchmarks/id.sh dump-platform-id $tmp_dir
local shell_id
local platform_id
local host_id
host_id=$(benchmarks/id.sh publish-platform-id $tmp_dir)
echo $host $host_id
platform_id=$(benchmarks/id.sh publish-platform-id $tmp_dir)
echo $platform_id
local shell_id
#for sh_path in bash dash mksh zsh; do
for sh_path in bash dash mksh zsh bin/osh _bin/osh; do
@@ -119,15 +123,15 @@ run() {
shell_id=$(benchmarks/id.sh publish-shell-id $tmp_dir)
echo "ID $shell_id"
echo "$sh_path ID: $shell_id"
# TODO: Shell ID should be separate columns?
# It's really shell_version_id?
if ! test -n "$preview"; then
# 20ms for ltmain.sh; 34ms for configure
cat $sorted | xargs -n 1 -- $0 \
sh-one $out $sh_path $platform_id $shell_id || true
sh-one $out $sh_path $host $host_id $shell_id || true
fi
done
@@ -171,12 +175,25 @@ _print-report() {
elapsed time measurements, but long files are chosen to minimize its
effect.</p>
<h3>Labels</h3>
<!-- TODO:
host ID | host label
[lisa-1234] lisa
[flanders-1234] flanders
shell ID | shell label
[osh-1234] osh-ovm
[osh-abcd] osh-host-cpython
-->
<h3>Summary</h3>
<table id="rate-summary">
EOF
web/table/csv_to_html.py < $BASE_DIR/stage1/rate_summary.csv
cat <<EOF
</table>
<h3>Elasped Time by File and Shell (milliseconds)</h3>
@@ -193,8 +210,6 @@ EOF
web/table/csv_to_html.py < $BASE_DIR/stage1/rate.csv
cat <<EOF
</table>
</table>
</body>
</html>
EOF

0 comments on commit 394b260

Please sign in to comment.