summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorRyan Geary <rtgnj42@gmail.com>2020-02-24 23:59:51 -0500
committerRyan Geary <rtgnj42@gmail.com>2020-03-10 00:03:14 -0400
commit389c29822b2af5f4a828734eb0a2d70b4f82a900 (patch)
tree7983809185cf846c2182f0eac89654359860d91a /test
parentc729ad3f004eb2313a4dfa206b7103939abeaac4 (diff)
Improve performance and add profiling tooling
Add tags, todo, *.bench, *.svg and bench_output to .gitignore Add test/bench.sh script. bench.sh runs the `bench` command on each test/long*txt file with range 3:5 and saves the output to a file for comparing performance across file sizes. Inline printing in get_choice_slice Change BufWriter<..stdout..> to BufWriter<T> Add MockStdout for testing printing Add more reverse range tests Simplify word finding with a more uniform bounds check. Add Makefile for generating flamegraphs Redefine Choice struct as a start and end integer Improve algorithm for finding words to print Settle exclusivity at Config construction time Add tests for nonexistant field_seps Add regression test for preceding separator Use handle.write instead of write! macro for tremendous speed up
Diffstat (limited to 'test')
-rwxr-xr-xtest/bench.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/bench.sh b/test/bench.sh
new file mode 100755
index 0000000..53160b1
--- /dev/null
+++ b/test/bench.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+cargo build --release # always be up to date
+output="bench_output"
+mkdir -p $output
+inputs=($(find test -name "long*txt" | sort -r))
+for i in {0..4}
+do
+ echo ${inputs[$i]}
+ bench "target/release/choose 3:5 -i ${inputs[$i]}" > $output/$1$i.bench
+done