From 8dd53dfd96892a452b8ac1392fec316c0e68cc2c Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Tue, 16 Mar 2021 15:52:43 -0400 Subject: [PATCH 1/4] fix: Flush log on sigterm --- runtime/src/main.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/runtime/src/main.c b/runtime/src/main.c index 795f2c5..a28eeab 100644 --- a/runtime/src/main.c +++ b/runtime/src/main.c @@ -182,9 +182,18 @@ runtime_start_runtime_worker_threads() debuglog("Sandboxing environment ready!\n"); } +void +runtime_cleanup() +{ + if (runtime_sandbox_perf_log != NULL) fflush(runtime_sandbox_perf_log); + + exit(EXIT_SUCCESS); +} + void runtime_configure() { + signal(SIGTERM, runtime_cleanup); /* Scheduler Policy */ char *scheduler_policy = getenv("SLEDGE_SCHEDULER"); if (scheduler_policy == NULL) scheduler_policy = "FIFO"; From 4aac09756608c49dc7b8efd383c1a428d32f99fd Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Tue, 16 Mar 2021 16:07:06 -0400 Subject: [PATCH 2/4] test: Add by word experiment --- .../applications/by_word/.gitignore | 5 ++ .../applications/by_word/README.md | 7 +++ .../experiments/applications/by_word/debug.sh | 19 +++++++ .../applications/by_word/install.sh | 4 ++ .../experiments/applications/by_word/run.sh | 53 +++++++++++++++++++ .../applications/by_word/spec.json | 42 +++++++++++++++ 6 files changed, 130 insertions(+) create mode 100644 runtime/experiments/applications/by_word/.gitignore create mode 100644 runtime/experiments/applications/by_word/README.md create mode 100755 runtime/experiments/applications/by_word/debug.sh create mode 100755 runtime/experiments/applications/by_word/install.sh create mode 100755 runtime/experiments/applications/by_word/run.sh create mode 100644 runtime/experiments/applications/by_word/spec.json diff --git a/runtime/experiments/applications/by_word/.gitignore b/runtime/experiments/applications/by_word/.gitignore new file mode 100644 index 0000000..be33735 --- /dev/null +++ b/runtime/experiments/applications/by_word/.gitignore @@ -0,0 +1,5 @@ +*.pnm +*.png +*.csv +*.txt +*.log diff --git a/runtime/experiments/applications/by_word/README.md b/runtime/experiments/applications/by_word/README.md new file mode 100644 index 0000000..29a1406 --- /dev/null +++ b/runtime/experiments/applications/by_word/README.md @@ -0,0 +1,7 @@ +# OCR varied by word + +Generates pnm image files containing random words from the wamerican dictionary. + +The number of words are varied between 1, 10, 100 in order to assess how the size of text OCRed affects the execution profile of the sandbox serving the request. + +Run `install.sh` to install required tools and `run.sh` to run the tests. diff --git a/runtime/experiments/applications/by_word/debug.sh b/runtime/experiments/applications/by_word/debug.sh new file mode 100755 index 0000000..a561392 --- /dev/null +++ b/runtime/experiments/applications/by_word/debug.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# Executes the runtime in GDB +# Substitutes the absolute path from the container with a path relatively derived from the location of this script +# This allows debugging outside of the Docker container +# Also disables pagination and stopping on SIGUSR1 + +experiment_directory=$(pwd) +project_directory=$(cd ../../.. && pwd) +binary_directory=$(cd "$project_directory"/bin && pwd) + +export LD_LIBRARY_PATH="$binary_directory:$LD_LIBRARY_PATH" +export PATH="$binary_directory:$PATH" + +gdb --eval-command="handle SIGUSR1 nostop" \ + --eval-command="handle SIGPIPE nostop" \ + --eval-command="set pagination off" \ + --eval-command="set substitute-path /sledge/runtime $project_directory" \ + --eval-command="run $experiment_directory/spec.json" \ + sledgert diff --git a/runtime/experiments/applications/by_word/install.sh b/runtime/experiments/applications/by_word/install.sh new file mode 100755 index 0000000..5186d30 --- /dev/null +++ b/runtime/experiments/applications/by_word/install.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +# Installs the deps needed for run.sh +sudo apt-get install netpbm pango1.0-tools wamerican diff --git a/runtime/experiments/applications/by_word/run.sh b/runtime/experiments/applications/by_word/run.sh new file mode 100755 index 0000000..e4a4354 --- /dev/null +++ b/runtime/experiments/applications/by_word/run.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# Executes the runtime in GDB +# Substitutes the absolute path from the container with a path relatively derived from the location of this script +# This allows debugging outside of the Docker container +# Also disables pagination and stopping on SIGUSR1 + +experiment_directory=$(pwd) +project_directory=$(cd ../../.. && pwd) +binary_directory=$(cd "$project_directory"/bin && pwd) +log="$experiment_directory/log.csv" + +if [ "$1" != "-d" ]; then + SLEDGE_SANDBOX_PERF_LOG=$log PATH="$binary_directory:$PATH" LD_LIBRARY_PATH="$binary_directory:$LD_LIBRARY_PATH" sledgert "$experiment_directory/spec.json" >rt.log 2>&1 & + sleep 2 +else + echo "Running under gdb" +fi + +word_counts=(1 10 100) + +declare -A word_count_to_port +word_count_to_port["1_words.pnm"]=10000 +word_count_to_port["10_words.pnm"]=10001 +word_count_to_port["100_words.pnm"]=10002 + +total_count=100 + +for ((i = 0; i < total_count; i++)); do + echo "$i" + + for word_count in "${word_counts[@]}"; do + echo "${word_count}"_words.pnm + words="$(shuf -n"$word_count" /usr/share/dict/american-english)" + pango-view --font=mono -qo "$word_count"_words.png -t "$words" + pngtopnm "$word_count"_words.png >"$word_count"_words.pnm + + result=$(curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary @"${word_count}"_words.pnm localhost:${word_count_to_port["$word_count"_words.pnm]} 2>/dev/null) + + diff -ywBZE --suppress-common-lines <(echo "$words") <(echo "$result") + echo "===============================================" + done + +done + +if [ "$1" != "-d" ]; then + sleep 2 + echo -n "Running Cleanup: " + rm ./*.png ./*.pnm + pkill --signal sigterm sledgert >/dev/null 2>/dev/null + sleep 2 + pkill sledgert -9 >/dev/null 2>/dev/null + echo "[DONE]" +fi diff --git a/runtime/experiments/applications/by_word/spec.json b/runtime/experiments/applications/by_word/spec.json new file mode 100644 index 0000000..f820aaf --- /dev/null +++ b/runtime/experiments/applications/by_word/spec.json @@ -0,0 +1,42 @@ +{ + "active": "yes", + "name": "gocr_1_word", + "path": "gocr_wasm.so", + "port": 10000, + "relative-deadline-us": 50000000000, + "argsize": 1, + "http-req-headers": [], + "http-req-content-type": "text/plain", + "http-req-size": 5335057, + "http-resp-headers": [], + "http-resp-size": 5335057, + "http-resp-content-type": "text/plain" +}, +{ + "active": "yes", + "name": "gocr_10_words", + "path": "gocr_wasm.so", + "port": 10001, + "relative-deadline-us": 50000000000, + "argsize": 1, + "http-req-headers": [], + "http-req-content-type": "text/plain", + "http-req-size": 5335057, + "http-resp-headers": [], + "http-resp-size": 5335057, + "http-resp-content-type": "text/plain" +}, +{ + "active": "yes", + "name": "gocr_100_words", + "path": "gocr_wasm.so", + "port": 10002, + "relative-deadline-us": 50000000000, + "argsize": 1, + "http-req-headers": [], + "http-req-content-type": "text/plain", + "http-req-size": 5335057, + "http-resp-headers": [], + "http-resp-size": 5335057, + "http-resp-content-type": "text/plain" +} From 4c1c6f0ff4eee327bfaddd17cb4fd306640f6195 Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Tue, 16 Mar 2021 20:48:51 -0400 Subject: [PATCH 3/4] test: Add experiments for by font and by size --- .../applications/by_font/.gitignore | 5 ++ .../applications/by_font/README.md | 7 ++ .../experiments/applications/by_font/debug.sh | 19 ++++++ .../applications/by_font/install.sh | 4 ++ .../experiments/applications/by_font/run.sh | 65 +++++++++++++++++++ .../applications/by_font/spec.json | 42 ++++++++++++ .../applications/by_size/.gitignore | 5 ++ .../applications/by_size/README.md | 7 ++ .../experiments/applications/by_size/debug.sh | 19 ++++++ .../applications/by_size/install.sh | 4 ++ .../experiments/applications/by_size/run.sh | 54 +++++++++++++++ .../applications/by_size/spec.json | 42 ++++++++++++ 12 files changed, 273 insertions(+) create mode 100644 runtime/experiments/applications/by_font/.gitignore create mode 100644 runtime/experiments/applications/by_font/README.md create mode 100755 runtime/experiments/applications/by_font/debug.sh create mode 100755 runtime/experiments/applications/by_font/install.sh create mode 100755 runtime/experiments/applications/by_font/run.sh create mode 100644 runtime/experiments/applications/by_font/spec.json create mode 100644 runtime/experiments/applications/by_size/.gitignore create mode 100644 runtime/experiments/applications/by_size/README.md create mode 100755 runtime/experiments/applications/by_size/debug.sh create mode 100755 runtime/experiments/applications/by_size/install.sh create mode 100755 runtime/experiments/applications/by_size/run.sh create mode 100644 runtime/experiments/applications/by_size/spec.json diff --git a/runtime/experiments/applications/by_font/.gitignore b/runtime/experiments/applications/by_font/.gitignore new file mode 100644 index 0000000..be33735 --- /dev/null +++ b/runtime/experiments/applications/by_font/.gitignore @@ -0,0 +1,5 @@ +*.pnm +*.png +*.csv +*.txt +*.log diff --git a/runtime/experiments/applications/by_font/README.md b/runtime/experiments/applications/by_font/README.md new file mode 100644 index 0000000..29a1406 --- /dev/null +++ b/runtime/experiments/applications/by_font/README.md @@ -0,0 +1,7 @@ +# OCR varied by word + +Generates pnm image files containing random words from the wamerican dictionary. + +The number of words are varied between 1, 10, 100 in order to assess how the size of text OCRed affects the execution profile of the sandbox serving the request. + +Run `install.sh` to install required tools and `run.sh` to run the tests. diff --git a/runtime/experiments/applications/by_font/debug.sh b/runtime/experiments/applications/by_font/debug.sh new file mode 100755 index 0000000..a561392 --- /dev/null +++ b/runtime/experiments/applications/by_font/debug.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# Executes the runtime in GDB +# Substitutes the absolute path from the container with a path relatively derived from the location of this script +# This allows debugging outside of the Docker container +# Also disables pagination and stopping on SIGUSR1 + +experiment_directory=$(pwd) +project_directory=$(cd ../../.. && pwd) +binary_directory=$(cd "$project_directory"/bin && pwd) + +export LD_LIBRARY_PATH="$binary_directory:$LD_LIBRARY_PATH" +export PATH="$binary_directory:$PATH" + +gdb --eval-command="handle SIGUSR1 nostop" \ + --eval-command="handle SIGPIPE nostop" \ + --eval-command="set pagination off" \ + --eval-command="set substitute-path /sledge/runtime $project_directory" \ + --eval-command="run $experiment_directory/spec.json" \ + sledgert diff --git a/runtime/experiments/applications/by_font/install.sh b/runtime/experiments/applications/by_font/install.sh new file mode 100755 index 0000000..5186d30 --- /dev/null +++ b/runtime/experiments/applications/by_font/install.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +# Installs the deps needed for run.sh +sudo apt-get install netpbm pango1.0-tools wamerican diff --git a/runtime/experiments/applications/by_font/run.sh b/runtime/experiments/applications/by_font/run.sh new file mode 100755 index 0000000..86234ed --- /dev/null +++ b/runtime/experiments/applications/by_font/run.sh @@ -0,0 +1,65 @@ +#!/bin/bash +# Executes the runtime in GDB +# Substitutes the absolute path from the container with a path relatively derived from the location of this script +# This allows debugging outside of the Docker container +# Also disables pagination and stopping on SIGUSR1 + +experiment_directory=$(pwd) +project_directory=$(cd ../../.. && pwd) +binary_directory=$(cd "$project_directory"/bin && pwd) +log="$experiment_directory/log.csv" + +if [ "$1" != "-d" ]; then + SLEDGE_SANDBOX_PERF_LOG=$log PATH="$binary_directory:$PATH" LD_LIBRARY_PATH="$binary_directory:$LD_LIBRARY_PATH" sledgert "$experiment_directory/spec.json" >rt.log 2>&1 & + sleep 2 +else + echo "Running under gdb" +fi + +word_count=100 +fonts=("mono" "URW Gothic" "Lobster Two") +total_count=100 + +for ((i = 1; i <= total_count; i++)); do + echo "Test $i" + words="$(shuf -n"$word_count" /usr/share/dict/american-english)" + + for font in "${fonts[@]}"; do + # For whatever reason, templating in multiple word strips was a pain, so brute forcing + case "$font" in + "mono") + echo "Mono" + pango-view --font="mono" -qo mono_words.png -t "$words" + pngtopnm mono_words.png >mono_words.pnm + result=$(curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary @mono_words.pnm localhost:10000 2>/dev/null) + diff -ywBZE --suppress-common-lines <(echo "$words") <(echo "$result") + ;; + "URW Gothic") + echo "URW Gothic" + pango-view --font="URW Gothic" -qo URW_Gothic_words.png -t "$words" + pngtopnm URW_Gothic_words.png >URW_Gothic_words.pnm + result=$(curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary @URW_Gothic_words.pnm localhost:10002 2>/dev/null) + diff -ywBZE --suppress-common-lines <(echo "$words") <(echo "$result") + ;; + "Lobster Two") + echo "Lobster Two" + pango-view --font="Lobster Two" -qo Lobster_Two_words.png -t "$words" + pngtopnm Lobster_Two_words.png >Lobster_Two_words.pnm + result=$(curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary @Lobster_Two_words.pnm localhost:10001 2>/dev/null) + diff -ywBZE --suppress-common-lines <(echo "$words") <(echo "$result") + ;; + esac + echo "===============================================" + done + +done + +if [ "$1" != "-d" ]; then + sleep 2 + echo -n "Running Cleanup: " + rm ./*.png ./*.pnm + pkill --signal sigterm sledgert >/dev/null 2>/dev/null + sleep 2 + pkill sledgert -9 >/dev/null 2>/dev/null + echo "[DONE]" +fi diff --git a/runtime/experiments/applications/by_font/spec.json b/runtime/experiments/applications/by_font/spec.json new file mode 100644 index 0000000..702624b --- /dev/null +++ b/runtime/experiments/applications/by_font/spec.json @@ -0,0 +1,42 @@ +{ + "active": "yes", + "name": "gocr_mono", + "path": "gocr_wasm.so", + "port": 10000, + "relative-deadline-us": 50000000000, + "argsize": 1, + "http-req-headers": [], + "http-req-content-type": "text/plain", + "http-req-size": 5335057, + "http-resp-headers": [], + "http-resp-size": 5335057, + "http-resp-content-type": "text/plain" +}, +{ + "active": "yes", + "name": "gocr_urw_gothic", + "path": "gocr_wasm.so", + "port": 10001, + "relative-deadline-us": 50000000000, + "argsize": 1, + "http-req-headers": [], + "http-req-content-type": "text/plain", + "http-req-size": 5335057, + "http-resp-headers": [], + "http-resp-size": 5335057, + "http-resp-content-type": "text/plain" +}, +{ + "active": "yes", + "name": "gocr_lobster_2", + "path": "gocr_wasm.so", + "port": 10002, + "relative-deadline-us": 50000000000, + "argsize": 1, + "http-req-headers": [], + "http-req-content-type": "text/plain", + "http-req-size": 5335057, + "http-resp-headers": [], + "http-resp-size": 5335057, + "http-resp-content-type": "text/plain" +} diff --git a/runtime/experiments/applications/by_size/.gitignore b/runtime/experiments/applications/by_size/.gitignore new file mode 100644 index 0000000..be33735 --- /dev/null +++ b/runtime/experiments/applications/by_size/.gitignore @@ -0,0 +1,5 @@ +*.pnm +*.png +*.csv +*.txt +*.log diff --git a/runtime/experiments/applications/by_size/README.md b/runtime/experiments/applications/by_size/README.md new file mode 100644 index 0000000..29a1406 --- /dev/null +++ b/runtime/experiments/applications/by_size/README.md @@ -0,0 +1,7 @@ +# OCR varied by word + +Generates pnm image files containing random words from the wamerican dictionary. + +The number of words are varied between 1, 10, 100 in order to assess how the size of text OCRed affects the execution profile of the sandbox serving the request. + +Run `install.sh` to install required tools and `run.sh` to run the tests. diff --git a/runtime/experiments/applications/by_size/debug.sh b/runtime/experiments/applications/by_size/debug.sh new file mode 100755 index 0000000..a561392 --- /dev/null +++ b/runtime/experiments/applications/by_size/debug.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# Executes the runtime in GDB +# Substitutes the absolute path from the container with a path relatively derived from the location of this script +# This allows debugging outside of the Docker container +# Also disables pagination and stopping on SIGUSR1 + +experiment_directory=$(pwd) +project_directory=$(cd ../../.. && pwd) +binary_directory=$(cd "$project_directory"/bin && pwd) + +export LD_LIBRARY_PATH="$binary_directory:$LD_LIBRARY_PATH" +export PATH="$binary_directory:$PATH" + +gdb --eval-command="handle SIGUSR1 nostop" \ + --eval-command="handle SIGPIPE nostop" \ + --eval-command="set pagination off" \ + --eval-command="set substitute-path /sledge/runtime $project_directory" \ + --eval-command="run $experiment_directory/spec.json" \ + sledgert diff --git a/runtime/experiments/applications/by_size/install.sh b/runtime/experiments/applications/by_size/install.sh new file mode 100755 index 0000000..5186d30 --- /dev/null +++ b/runtime/experiments/applications/by_size/install.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +# Installs the deps needed for run.sh +sudo apt-get install netpbm pango1.0-tools wamerican diff --git a/runtime/experiments/applications/by_size/run.sh b/runtime/experiments/applications/by_size/run.sh new file mode 100755 index 0000000..c5f49ce --- /dev/null +++ b/runtime/experiments/applications/by_size/run.sh @@ -0,0 +1,54 @@ +#!/bin/bash +# Executes the runtime in GDB +# Substitutes the absolute path from the container with a path relatively derived from the location of this script +# This allows debugging outside of the Docker container +# Also disables pagination and stopping on SIGUSR1 + +experiment_directory=$(pwd) +project_directory=$(cd ../../.. && pwd) +binary_directory=$(cd "$project_directory"/bin && pwd) +log="$experiment_directory/log.csv" + +if [ "$1" != "-d" ]; then + SLEDGE_SANDBOX_PERF_LOG=$log PATH="$binary_directory:$PATH" LD_LIBRARY_PATH="$binary_directory:$LD_LIBRARY_PATH" sledgert "$experiment_directory/spec.json" >rt.log 2>&1 & + sleep 2 +else + echo "Running under gdb" +fi + +word_count=100 +dpis=(72 108 144) + +declare -A dpi_to_port +dpi_to_port[72]=10000 +dpi_to_port[108]=10001 +dpi_to_port[144]=10002 + +total_count=100 + +for ((i = 0; i < total_count; i++)); do + echo "$i" + words="$(shuf -n"$word_count" /usr/share/dict/american-english)" + + for dpi in "${dpis[@]}"; do + echo "${dpi}"_dpi.pnm + pango-view --dpi=$dpi --font=mono -qo "${dpi}"_dpi.png -t "$words" + pngtopnm "${dpi}"_dpi.png >"${dpi}"_dpi.pnm + + result=$(curl -H 'Expect:' -H "Content-Type: text/plain" --data-binary @"${dpi}"_dpi.pnm localhost:${dpi_to_port[$dpi]} 2>/dev/null) + + diff -ywBZE --suppress-common-lines <(echo "$words") <(echo "$result") + echo "===============================================" + done + +done + +if [ "$1" != "-d" ]; then + sleep 2 + echo -n "Running Cleanup: " + rm ./*.png ./*.pnm + pkill --signal sigterm sledgert >/dev/null 2>/dev/null + sleep 2 + pkill sledgert -9 >/dev/null 2>/dev/null + echo "[DONE]" +fi diff --git a/runtime/experiments/applications/by_size/spec.json b/runtime/experiments/applications/by_size/spec.json new file mode 100644 index 0000000..030eaec --- /dev/null +++ b/runtime/experiments/applications/by_size/spec.json @@ -0,0 +1,42 @@ +{ + "active": "yes", + "name": "gocr_72_dpi", + "path": "gocr_wasm.so", + "port": 10000, + "relative-deadline-us": 50000000000, + "argsize": 1, + "http-req-headers": [], + "http-req-content-type": "text/plain", + "http-req-size": 5335057, + "http-resp-headers": [], + "http-resp-size": 5335057, + "http-resp-content-type": "text/plain" +}, +{ + "active": "yes", + "name": "gocr_108_dpi", + "path": "gocr_wasm.so", + "port": 10001, + "relative-deadline-us": 50000000000, + "argsize": 1, + "http-req-headers": [], + "http-req-content-type": "text/plain", + "http-req-size": 5335057, + "http-resp-headers": [], + "http-resp-size": 5335057, + "http-resp-content-type": "text/plain" +}, +{ + "active": "yes", + "name": "gocr_144_dpi", + "path": "gocr_wasm.so", + "port": 10002, + "relative-deadline-us": 50000000000, + "argsize": 1, + "http-req-headers": [], + "http-req-content-type": "text/plain", + "http-req-size": 5335057, + "http-resp-headers": [], + "http-resp-size": 5335057, + "http-resp-content-type": "text/plain" +} From d52d8e68a69b1cc2f8c443294e15f3ee2423cd72 Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Tue, 16 Mar 2021 20:53:11 -0400 Subject: [PATCH 4/4] chore: clean up dpi and update READMEs --- .../applications/{by_size => by_dpi}/.gitignore | 0 runtime/experiments/applications/by_dpi/README.md | 7 +++++++ .../experiments/applications/{by_size => by_dpi}/debug.sh | 0 .../applications/{by_size => by_dpi}/install.sh | 0 .../experiments/applications/{by_size => by_dpi}/run.sh | 0 .../experiments/applications/{by_size => by_dpi}/spec.json | 0 runtime/experiments/applications/by_font/README.md | 4 ++-- runtime/experiments/applications/by_size/README.md | 7 ------- 8 files changed, 9 insertions(+), 9 deletions(-) rename runtime/experiments/applications/{by_size => by_dpi}/.gitignore (100%) create mode 100644 runtime/experiments/applications/by_dpi/README.md rename runtime/experiments/applications/{by_size => by_dpi}/debug.sh (100%) rename runtime/experiments/applications/{by_size => by_dpi}/install.sh (100%) rename runtime/experiments/applications/{by_size => by_dpi}/run.sh (100%) rename runtime/experiments/applications/{by_size => by_dpi}/spec.json (100%) delete mode 100644 runtime/experiments/applications/by_size/README.md diff --git a/runtime/experiments/applications/by_size/.gitignore b/runtime/experiments/applications/by_dpi/.gitignore similarity index 100% rename from runtime/experiments/applications/by_size/.gitignore rename to runtime/experiments/applications/by_dpi/.gitignore diff --git a/runtime/experiments/applications/by_dpi/README.md b/runtime/experiments/applications/by_dpi/README.md new file mode 100644 index 0000000..7c3880b --- /dev/null +++ b/runtime/experiments/applications/by_dpi/README.md @@ -0,0 +1,7 @@ +# OCR varied by DPI + +Generates pnm image files containing random words from the wamerican dictionary. + +The number of words are held constant at 100, and the `mono` font is used for all runs. The dpi of the image is varied to judge how more visual details affects OCR accuracy and performance. + +Run `install.sh` to install required tools and `run.sh` to run the tests. diff --git a/runtime/experiments/applications/by_size/debug.sh b/runtime/experiments/applications/by_dpi/debug.sh similarity index 100% rename from runtime/experiments/applications/by_size/debug.sh rename to runtime/experiments/applications/by_dpi/debug.sh diff --git a/runtime/experiments/applications/by_size/install.sh b/runtime/experiments/applications/by_dpi/install.sh similarity index 100% rename from runtime/experiments/applications/by_size/install.sh rename to runtime/experiments/applications/by_dpi/install.sh diff --git a/runtime/experiments/applications/by_size/run.sh b/runtime/experiments/applications/by_dpi/run.sh similarity index 100% rename from runtime/experiments/applications/by_size/run.sh rename to runtime/experiments/applications/by_dpi/run.sh diff --git a/runtime/experiments/applications/by_size/spec.json b/runtime/experiments/applications/by_dpi/spec.json similarity index 100% rename from runtime/experiments/applications/by_size/spec.json rename to runtime/experiments/applications/by_dpi/spec.json diff --git a/runtime/experiments/applications/by_font/README.md b/runtime/experiments/applications/by_font/README.md index 29a1406..5c77ee2 100644 --- a/runtime/experiments/applications/by_font/README.md +++ b/runtime/experiments/applications/by_font/README.md @@ -1,7 +1,7 @@ -# OCR varied by word +# OCR varied by font Generates pnm image files containing random words from the wamerican dictionary. -The number of words are varied between 1, 10, 100 in order to assess how the size of text OCRed affects the execution profile of the sandbox serving the request. +The number of words is held constant at 100, but a different font is used to render the text. Generally, `mono` performs the best, followed by `URW Gothic`, followed by `Lobster Two`, which is a stylistic font that performs quite poorly. Run `install.sh` to install required tools and `run.sh` to run the tests. diff --git a/runtime/experiments/applications/by_size/README.md b/runtime/experiments/applications/by_size/README.md deleted file mode 100644 index 29a1406..0000000 --- a/runtime/experiments/applications/by_size/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# OCR varied by word - -Generates pnm image files containing random words from the wamerican dictionary. - -The number of words are varied between 1, 10, 100 in order to assess how the size of text OCRed affects the execution profile of the sandbox serving the request. - -Run `install.sh` to install required tools and `run.sh` to run the tests.