diff --git a/tools/impact b/tools/impact index f7d5bdf..92099ec 100755 --- a/tools/impact +++ b/tools/impact @@ -12,10 +12,17 @@ prepare() { jake build } -measure_speed() { +run_benchmark() { echo $(jake benchmark | awk 'BEGIN { FS = " *│ *" } /Total/ { split($5, a, " "); print a[1] }') } +measure_speed() { + bc <<-EOT + scale = 2 + ($(run_benchmark) + $(run_benchmark) + $(run_benchmark) + $(run_benchmark) + $(run_benchmark)) / 5 +EOT +} + measure_size() { for file in examples/*.pegjs; do bin/pegjs "$file"