Skip to content

Commit 189fa32

Browse files
Reformat a comment.
Comment out some of slower tests, to focus on a few faster ones.
1 parent dd72610 commit 189fa32

File tree

1 file changed

+25
-26
lines changed

1 file changed

+25
-26
lines changed

source/tests/compare_various_apis.sh

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ function run_test()
7777
cmdbasename=$(basename $cmdfullpath)
7878
cmdwithargs="$*"
7979

80-
test -f "$cmdfullpath" -a -x "$cmdfullpath" || return
80+
test -f "$cmdfullpath" -a -x "$cmdfullpath" || { sleep 1; return; }
8181

8282
# Final CSV fields in each line of test result output:
8383
# $cmdbasename,$nlines,$linelen,$nloops,$TIMEFMT
@@ -154,7 +154,7 @@ function run_test()
154154
# 8 to 4096 bytes, and then repeatedly run our various test
155155
# cases in a loop (above "run_test()" code).
156156

157-
for log2linelen in $(seq 3 12) # line lengths 8 to 4096
157+
for log2linelen in $(seq 3 12) # line lengths 8 to 4096
158158
do
159159
for log2nlines in $(seq 3 16) # number lines 8 to 65536
160160
do
@@ -163,31 +163,30 @@ function run_test()
163163
random_line_generator -n $nlines -m $linelen -M $linelen -R > $shm.1
164164

165165
# Feed data into tests using "cat ... |" pipeline,
166-
# rather than i/o redirction '<', to keep commands
167-
# such as "grep" from cheating and mmap'ing their
168-
# input. Similarly, discard any "stdout" test
169-
# output via another "| cat > /dev/null" pipeline,
170-
# so that grep can't cheat again by using "splice(2)"
171-
# to discard output more quickly if it notices that
172-
# its output goes to "/dev/null." Perhaps more
173-
# importantly, since the primary expected use
174-
# for rawscan is by text processing commands in
175-
# pipelines, it drrmd most relevant to test rawscan
176-
# and its various competitors in such pipelines.
166+
# rather than i/o redirction '<', to keep commands such
167+
# as "grep" from cheating and mmap'ing their input.
168+
# Similarly, discard any "stdout" test output via another
169+
# "| cat > /dev/null" pipeline, so that grep can't
170+
# cheat again by using "splice(2)" to discard output
171+
# more quickly if it notices that its output goes to
172+
# "/dev/null." Perhaps more importantly, since the
173+
# primary expected use for rawscan is by text processing
174+
# commands in pipelines, it seemed most relevant to test
175+
# rawscan and its various competitors in such pipelines.
177176

178177
# Feed each test command from a separate dedicated
179178
# "cat ... |" pipeline, rather than using zsh multios
180179
# parallel magic to duplicate a single source to each
181180
# consumer. Do this so we can get useful, independent,
182181
# measurements of their total elapsed time.
183182
#
184-
# BEWARE: Elapsed timings from the following won't
185-
# mean as much if you don't have enough cores/threads
186-
# to run all these in parallel, including the input
187-
# and output cat commands.
183+
# BEWARE: Elapsed timings from the following won't mean
184+
# as much if you don't have enough cores/threads to run
185+
# all these in parallel, including the input and output
186+
# cat commands and (above) the encompassing zsh commands.
188187

189-
# Let's reuse the above random input 10 times,
190-
# to amortize the cost of generating it.
188+
# Let's reuse the above random input 10 times, to
189+
# amortize the cost of generating it.
191190

192191
repeat 10 {
193192
(
@@ -197,16 +196,16 @@ function run_test()
197196
cat $shm.1 | run_test rawscan_static_test &
198197
cat $shm.1 | run_test getline_test &
199198
cat $shm.1 | run_test fgets_test &
200-
cat $shm.1 | run_test grep '^abc' &
201-
cat $shm.1 | run_test sed -n '/^abc/p' &
202-
cat $shm.1 | run_test $rust_bufreader &
203-
cat $shm.1 | run_test python2 python2_test &
204-
cat $shm.1 | run_test python3 python3_test &
205-
cat $shm.1 | run_test awk '/^abc/' &
199+
# cat $shm.1 | run_test grep '^abc' &
200+
# cat $shm.1 | run_test sed -n '/^abc/p' &
201+
# cat $shm.1 | run_test $rust_bufreader &
202+
# cat $shm.1 | run_test python2 python2_test &
203+
# cat $shm.1 | run_test python3 python3_test &
204+
# cat $shm.1 | run_test awk '/^abc/' &
206205
wait
207206
) | cat > /dev/null
208207
) 2>&1 |
209-
sort -t, -k7,7n # sort runs on $nloops for easier viewing
208+
sort -t, -k4,4n # sort runs on $nloops for easier viewing
210209
}
211210
done
212211
done

0 commit comments

Comments
 (0)