diff --git a/examples/run_benches.ion b/examples/run_benches.ion new file mode 100755 index 0000000000000000000000000000000000000000..4bf68b448ea5d22e5b61a891b28ab3ef048c184c --- /dev/null +++ b/examples/run_benches.ion @@ -0,0 +1,17 @@ + +# Function for timing each individual script +fn check_timing script + # set var utime to time of executing script + let utime = $(time $script > /dev/null) + echo $script $utime +end + +cargo build --release + +for file in ./*.ion + check_timing $file >> temp.out +end + + +cat temp.out | column -t + diff --git a/examples/run_benches.sh b/examples/run_benches.sh deleted file mode 100755 index b4f5135d73c89a9d8071d3d98b844944c84e3ec8..0000000000000000000000000000000000000000 --- a/examples/run_benches.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash - -set -e -u -o pipefail - -EXAMPLES_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -PROJECT_DIR=$(dirname $(cargo locate-project | awk -F\" '{print $4}')) - -TIMEFORMAT='%U seconds' - -# Some of the examples assume that the working directory is the project root -# and it never hurts to force consistency regardless -cd $PROJECT_DIR - -function check_timing { - - # Run script and redirect error to /dev/null - utime="$( time ( $PROJECT_DIR/target/release/ion $1 2> /dev/null) 2>&1 1>/dev/null )" - echo $1 $utime -} - -# Build release binary -#cargo build --release - -set +e -# Iterate over every Ion script in examples directory -for i in $EXAMPLES_DIR/*.ion; do - check_timing $i >> $EXAMPLES_DIR/temp.out; -done - -cat $EXAMPLES_DIR/temp.out | column -t; - -rm $EXAMPLES_DIR/temp.out; - -exit 0 diff --git a/examples/temp.out b/examples/temp.out new file mode 100644 index 0000000000000000000000000000000000000000..b0db5a1fbc0830874835f3934368f75c78aa7349 --- /dev/null +++ b/examples/temp.out @@ -0,0 +1,74 @@ +array_assignments.ion real 0.000707967s +array_methods.ion real 0.000614490s +arrays.ion real 0.000230625s +arrays_with_braces.ion real 0.000273186s +basic_condition.ion real 0.000169015s +braces.ion real 0.000195244s +break.ion real 0.000169389s +builtin_piping.ion real 0.000159991s +color_test.ion real 0.000157299s +command-substitutions.ion real 0.000232565s +comments.ion real 0.000241960s +conditionals.ion real 0.000297259s +continue.ion real 0.000541555s +else_if.ion real 0.000681170s +exists.ion real 0.000478833s +fail.ion real 0.000186693s +fibonacci.ion real 0.000169281s +fn.ion real 0.000196907s +for.ion real 0.000170117s +function_piping.ion real 0.000167647s +glob.ion real 0.000166657s +herestring.ion real 0.000157875s +inner_expansions.ion real 0.000154253s +let.ion real 0.000171546s +match.ion real 0.000170947s +methods.ion real 0.000166563s +multiline-arrays.ion real 0.000157506s +multiple-lines.ion real 0.000153808s +nested_conditions.ion real 0.000156380s +nested_for.ion real 0.000228605s +not.ion real 0.000862901s +pipelines.ion real 0.000316426s +run_benches.ion real 0.000433918s +scopes.ion real 0.000211059s +script_exec.ion real 0.000346293s +strings.ion real 0.000556460s +while.ion real 0.000344735s +array_assignments.ion real 0.000237393s +array_methods.ion real 0.000337806s +arrays.ion real 0.000217764s +arrays_with_braces.ion real 0.000192064s +basic_condition.ion real 0.000193875s +braces.ion real 0.000167272s +break.ion real 0.000291519s +builtin_piping.ion real 0.000261215s +color_test.ion real 0.000194242s +command-substitutions.ion real 0.000160982s +comments.ion real 0.000173632s +conditionals.ion real 0.000171690s +continue.ion real 0.000181039s +else_if.ion real 0.000171514s +exists.ion real 0.000174935s +fail.ion real 0.000212720s +fibonacci.ion real 0.000195493s +fn.ion real 0.000181608s +for.ion real 0.000182082s +function_piping.ion real 0.000163367s +glob.ion real 0.000160634s +herestring.ion real 0.000159208s +inner_expansions.ion real 0.000174614s +let.ion real 0.000166230s +match.ion real 0.000179143s +methods.ion real 0.000170653s +multiline-arrays.ion real 0.000165024s +multiple-lines.ion real 0.000160597s +nested_conditions.ion real 0.000159544s +nested_for.ion real 0.000162195s +not.ion real 0.000173877s +pipelines.ion real 0.000185679s +run_benches.ion real 0.000174290s +scopes.ion real 0.000164746s +script_exec.ion real 0.000160494s +strings.ion real 0.000157939s +while.ion real 0.000158173s