michael@0: #! /bin/bash michael@0: # michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: ######################################################################## michael@0: # michael@0: # mozilla/security/nss/tests/perf/perf.sh michael@0: # michael@0: # script run from the nightly NSS QA to measure nss performance michael@0: # needs to work on all Unix and Windows platforms michael@0: # michael@0: # special strings michael@0: # --------------- michael@0: # FIXME ... known problems, search for this string michael@0: # NOTE .... unexpected behavior michael@0: # michael@0: ######################################################################## michael@0: michael@0: ############################## perf_init ############################## michael@0: # local shell function to initialize this script michael@0: ######################################################################## michael@0: michael@0: perf_init() michael@0: { michael@0: SCRIPTNAME="perf.sh" michael@0: if [ -z "${INIT_SOURCED}" ] ; then michael@0: cd ../common michael@0: . ./init.sh michael@0: fi michael@0: SCRIPTNAME="perf.sh" michael@0: PERFDIR=${HOSTDIR}/perf michael@0: mkdir -p ${PERFDIR} michael@0: } michael@0: michael@0: perf_init michael@0: cd ${PERFDIR} michael@0: RSAPERF_OUT=`${BINDIR}/rsaperf -i 300 -s -n none` michael@0: RSAPERF_OUT=`echo $RSAPERF_OUT | sed \ michael@0: -e "s/^/RSAPERF: $OBJDIR /" \ michael@0: -e 's/microseconds/us/' \ michael@0: -e 's/milliseconds/ms/' \ michael@0: -e 's/seconds/s/' \ michael@0: -e 's/ minutes, and /_min_/'` michael@0: michael@0: echo "$RSAPERF_OUT" michael@0: michael@0: michael@0: michael@0: #FIXME michael@0: #export RSAPERF_OUT michael@0: # michael@0: #perl -e ' michael@0: michael@0: #@rsaperf=split(/ /, $ENV{RSAPERF_OUT}); michael@0: michael@0: #echo "${RSAPERF_OUT}" | read IT_NUM T1 T2 TOT_TIM TOT_TIM_U \ michael@0: #T3 T4 T5 AVRG_TIM AVRG_TIM_U michael@0: michael@0: #300 iterations in 8.881 seconds one operation every 29606 microseconds