1
0
Fork 0

Can now build multiple performance logs

`make perf` will build, by default, perf.log, but you may also build perf.*;
for example:

  $ make perf.1
  # make some changes
  $ make perf.2

This allows comparing changes easily.
newmaster
Mike Gerwitz 2014-03-29 20:13:26 -04:00
parent e85a7653e8
commit 1079630bd4
3 changed files with 7 additions and 12 deletions

2
.gitignore vendored
View File

@ -19,7 +19,7 @@ configure
config.* config.*
# script output # script output
perf.out perf.*
# should be added using autoreconf -i # should be added using autoreconf -i
INSTALL INSTALL

View File

@ -112,9 +112,10 @@ test: check
check: $(src_tests) test-suite check: $(src_tests) test-suite
# performance tests # performance tests
perf: perf: perf.log
perf.%: FORCE
if HAS_NODE if HAS_NODE
@$(path_test)/perf/runner @PERF_TESTS@ @$(path_test)/perf/runner @PERF_TESTS@ > "$@"
else else
@echo "Node.js must be installed in order to run performance tests" @echo "Node.js must be installed in order to run performance tests"
@exit 1 @exit 1

View File

@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
# #
# Copyright (C) 2014 Mike Gerwitz # Copyright (C) 2014 Mike Gerwitz
# #
@ -21,16 +21,10 @@
# $ column -ts\| perf.out # $ column -ts\| perf.out
# # # #
rawout=perf.out
>"$rawout"
for f in "$@"; do for f in "$@"; do
@NODE@ "$f" || exit $? @NODE@ "$f" || exit $?
done \ done \
| tee -a "$rawout" \ | tee >( awk -F\| '
| awk -F\| '
# format for display as the tests are running # format for display as the tests are running
{ printf "%s (x%s = %ss each): %s\n", $4, $2, $3, $1 } { printf "%s (x%s = %ss each): %s\n", $4, $2, $3, $1 }
' ' >&2 )
echo "Raw data written to $rawout" >&2