security/nss/tests/perf/perf.sh

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/security/nss/tests/perf/perf.sh	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,61 @@
     1.4 +#! /bin/bash  
     1.5 +#
     1.6 +# This Source Code Form is subject to the terms of the Mozilla Public
     1.7 +# License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 +# file, You can obtain one at http://mozilla.org/MPL/2.0/.
     1.9 +
    1.10 +########################################################################
    1.11 +#
    1.12 +# mozilla/security/nss/tests/perf/perf.sh
    1.13 +#
    1.14 +# script run from the nightly NSS QA to measure nss performance
    1.15 +# needs to work on all Unix and Windows platforms
    1.16 +#
    1.17 +# special strings
    1.18 +# ---------------
    1.19 +#   FIXME ... known problems, search for this string
    1.20 +#   NOTE .... unexpected behavior
    1.21 +#
    1.22 +########################################################################
    1.23 +
    1.24 +############################## perf_init ##############################
    1.25 +# local shell function to initialize this script
    1.26 +########################################################################
    1.27 +
    1.28 +perf_init()
    1.29 +{
    1.30 +  SCRIPTNAME="perf.sh"
    1.31 +  if [ -z "${INIT_SOURCED}" ] ; then
    1.32 +      cd ../common
    1.33 +      . ./init.sh
    1.34 +  fi
    1.35 +  SCRIPTNAME="perf.sh"
    1.36 +  PERFDIR=${HOSTDIR}/perf
    1.37 +  mkdir -p ${PERFDIR}
    1.38 +}
    1.39 +
    1.40 +perf_init
    1.41 +cd ${PERFDIR}
    1.42 +RSAPERF_OUT=`${BINDIR}/rsaperf -i 300 -s -n none`
    1.43 +RSAPERF_OUT=`echo $RSAPERF_OUT | sed \
    1.44 +                -e "s/^/RSAPERF: $OBJDIR /" \
    1.45 +                -e 's/microseconds/us/' \
    1.46 +                -e 's/milliseconds/ms/' \
    1.47 +                -e 's/seconds/s/' \
    1.48 +                -e 's/ minutes, and /_min_/'`
    1.49 +
    1.50 +echo "$RSAPERF_OUT"
    1.51 +
    1.52 +
    1.53 +
    1.54 +#FIXME
    1.55 +#export RSAPERF_OUT
    1.56 +#
    1.57 +#perl -e '
    1.58 +
    1.59 +#@rsaperf=split(/ /, $ENV{RSAPERF_OUT});
    1.60 +
    1.61 +#echo "${RSAPERF_OUT}" | read IT_NUM T1 T2 TOT_TIM TOT_TIM_U \
    1.62 +    #T3 T4 T5 AVRG_TIM AVRG_TIM_U
    1.63 +
    1.64 +#300 iterations in 8.881 seconds one operation every 29606 microseconds

mercurial