Skip to content

Commit

Permalink
Update benchmarks.
Browse files Browse the repository at this point in the history
Removed Mawk re1 test because mawk currently doesn't handle \w word boundaries
  • Loading branch information
James Parkinson committed Jul 18, 2021
1 parent 09c53ce commit dde3f5a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
12 changes: 11 additions & 1 deletion benchmark/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ array array2 array3 array4 array4b array4c array4d io::
@$(SEQCMD) $(TIME) -f "$@\tTCL \t%e sec" $(TCL) $@.tcl 2>>$@tres.out


cast expr function recurse split re1 re2 re2a::
cast expr function recurse split re2 re2a::
@echo $@
@$(AWKA) -f $@.awk >x.c
@$(CC) x.c $(CFLAGS)
Expand All @@ -79,6 +79,16 @@ cast expr function recurse split re1 re2 re2a::
@$(SEQCMD) $(TIME) -f "$@\tPERL\t%e sec" $(PERL) $@.pl 2>>$@plres.out
@$(SEQCMD) $(TIME) -f "$@\tPYTHON\t%e sec" $(PYTHON) $@.py 2>>$@pyres.out

re1::
@echo $@
@$(AWKA) -f $@.awk >x.c
@$(CC) x.c $(CFLAGS)
@$(SEQCMD) $(TIME) -f "$@\tAWKA\t%e sec" ./a.out 2>>$@ares.out
@# $(SEQCMD) $(TIME) -f "$@\tMAWK\t%e sec" $(MAWK) -f [email protected] 2>>[email protected]
@$(SEQCMD) $(TIME) -f "$@\tGAWK\t%e sec" $(GAWK) -f $@.awk 2>>$@gres.out
@$(SEQCMD) $(TIME) -f "$@\tPERL\t%e sec" $(PERL) $@.pl 2>>$@plres.out
@$(SEQCMD) $(TIME) -f "$@\tPYTHON\t%e sec" $(PYTHON) $@.py 2>>$@pyres.out

loop::
@echo $@
@$(AWKA) -f $@.awk >x.c
Expand Down
5 changes: 3 additions & 2 deletions benchmark/lib/benchmarksort.awk
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@ BEGIN {
name = $2
time = $3
split($3, T, " ")
tsum[type","name] += T[1]
tsum[type","name] += 10*T[1]
nr[type","name] += 1
typ[type] = type
}
END {
for(tn in tsum) {
split(tn, X, ",")
# times array - use asorti to sort indexes by time
t[tsum[tn]","X[1]","X[2]] = 1
av = tsum[tn] / nr[tn] / 10
t[av","X[1]","X[2]] = 1
}
asort(typ,typsorted)
asorti(t, tkeys)
Expand Down
2 changes: 2 additions & 0 deletions benchmark/re1.awk
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# MAWK does not handle \w word boundaries ??
#
BEGIN {
#print match("she sells seashells", /s \w/)
x = match("she sells seashells", /s \w/)
Expand Down

0 comments on commit dde3f5a

Please sign in to comment.