diff --git a/examples/bench_results.txt b/examples/bench_results.txt index 3ccaf6f46a1ee463b3baa1c64180b4b31bf07268..d8c1c99784cb6b10032cfa6cae62b6c62d16bbba 100644 --- a/examples/bench_results.txt +++ b/examples/bench_results.txt @@ -1,36 +1,36 @@ -array_assignments.ion 0.000378434s -array_methods.ion 0.000271493s -arrays.ion 0.000650006s -arrays_with_braces.ion 0.000245790s -basic_condition.ion 0.000240018s -braces.ion 0.000238225s -break.ion 0.000253894s -builtin_piping.ion 0.000238527s -color_test.ion 0.000240145s -command-substitutions.ion 0.000244207s -comments.ion 0.000237473s -conditionals.ion 0.000238094s -continue.ion 0.000239293s -else_if.ion 0.000238410s -exists.ion 0.000238906s -fail.ion 0.000248338s -fibonacci.ion 0.000249638s -fn.ion 0.000245006s -for.ion 0.000245794s -function_piping.ion 0.000248026s -glob.ion 0.000244100s -herestring.ion 0.000244468s -inner_expansions.ion 0.000250048s -let.ion 0.000243655s -match.ion 0.000244741s -methods.ion 0.000276658s -multiline-arrays.ion 0.000246785s -multiple-lines.ion 0.000245504s -nested_conditions.ion 0.000242605s -nested_for.ion 0.000226091s -not.ion 0.000242381s -pipelines.ion 0.000241742s -scopes.ion 0.000241499s -script_exec.ion 0.000233643s -strings.ion 0.000225746s -while.ion 0.000237478s +array_assignments.ion 0.000331540 +array_methods.ion 0.000286822 +arrays.ion 0.000155707 +arrays_with_braces.ion 0.000146670 +basic_condition.ion 0.000155057 +braces.ion 0.000152580 +break.ion 0.000158761 +builtin_piping.ion 0.000186408 +color_test.ion 0.000188989 +command-substitutions.ion 0.000173809 +comments.ion 0.000147198 +conditionals.ion 0.000160260 +continue.ion 0.000143139 +else_if.ion 0.000172871 +exists.ion 0.000159765 +fail.ion 0.000162390 +fibonacci.ion 0.000157263 +fn.ion 0.000159370 +for.ion 0.000162347 +function_piping.ion 0.000167740 +glob.ion 0.000184011 +herestring.ion 0.000190068 +inner_expansions.ion 0.000213646 +let.ion 0.000193824 +match.ion 0.000141248 +methods.ion 0.000151908 +multiline-arrays.ion 0.000151316 +multiple-lines.ion 0.000168683 +nested_conditions.ion 0.000163736 +nested_for.ion 0.000199267 +not.ion 0.000187366 +pipelines.ion 0.000155655 +scopes.ion 0.000185241 +script_exec.ion 0.000195759 +strings.ion 0.000240247 +while.ion 0.000191514 diff --git a/examples/run_benches b/examples/run_benches index 112776648ab68aa6bfea764a484b7e56e10bf4fd..105d37abf5e5bdc372b44de7242300a72e33105a 100755 --- a/examples/run_benches +++ b/examples/run_benches @@ -1,29 +1,30 @@ # /usr/bin/env ion -# Function for timing each individual script +# function for timing each individual script fn check_timing script - let utime = 0.0 - # set var utime to time of executing script - for n in 0..10 - let utime = @(time $script >/dev/null)[1] + let utime:float = 0.0 + # loop 10 times + for _ in 0..10 + # set to actual number part of time output, has "s" as end + let utime_arrval = @(time $script >/dev/null)[1] + # make it a string var + let utime_str:str = $utime_arrval + # remove s at end and add to total + let utime:float += $utime_str[..11] end - #let utime /= 10 - echo $script $utime + let utime /= 10 + echo $script $utime[..11] end #cargo build --release for file in ./*.ion - #if test $file == "run_benches.ion" - # continue - #end check_timing $file >> temp.out end +cat temp.out | column -t > bench_results.txt -cat temp.out | column -t - -cp temp.out bench_results.txt +cat bench_results.txt rm temp.out