#!/usr/bin/awk -f # Renders performance test output # # Copyright (C) 2014 Free Software Foundation, Inc. # # This file is part of GNU ease.js. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # If you want more modest output, consider running this command instead: # $ column -ts\| perf.out # # function styleout( i ) { value = $i # slow tests should reduce the number of iterations to eat up less time if ( ( i == COL_TOTAL ) && ( value > 0.05 ) ) { class = "slow" if ( value > 0.1 ) class = "very " class return "" value "" } else return value } BEGIN { # column constants COL_DESC = 1 COL_COUNT = 2 COL_SINGLE = 3 COL_TOTAL = 4 # running time tally runtime = 0.00 # header print "" \ "" \ "" \ "GNU ease.js Performance Test Results" \ "" \ "" \ "" \ "

GNU ease.js Performance Test Results

" \ "" \ "" \ "" \ "" \ "" \ "" \ "" \ "" \ "" \ "" } # format row of output (desc, count, time, total) { runtime += $COL_TOTAL printf "" for ( i = 1; i <= NF; i++ ) { printf "", styleout( i ) } printf "\n" } END { # footer print "" \ "
DescriptionIterationsSeconds/iterTotal (s)
%s
" \ "

Total running time: " runtime " seconds

" \ "" \ "" }