blob: 80287902502d093e10e64c0d9ec1af90cef7e712 [file] [log] [blame]
# -*- mode: org -*-
# Copyright (C) 2012 International Business Machines Corporation and Others. All Rights Reserved.
How Expensive Is It?
* Introduction
** The purpose of this test is to answer the question, "How expensive, relatively speaking, is ICU operation X?"
** ICU tests are compared with general purpose CPU operations to attempt to factor out differences between systems and load conditions
** Different ICU operations will have different levels of dependence on CPU, memory, disk, etc. So nothing can perfectly factor these conditions out.
* Running the Test
** Simply run "make check" in this directory, icu/source/test/perf/howExpensiveIs/
** Try to minimize other CPU loading throughout the test
** The test will take some time to run!
** Test runs outside of a margin of error will be thrown out. So, this will tend to produce more accurate results.
** After some time, the file howexpensive.xml will be created (an example is attached as Appendix I)
** The results may be read directly or processed such as with xslt.
** XML file contents:
*** Element <tests>: the outermost element.
*** Attribute 'icu': gives the basic ICU version number.
**** Element <test>: a particularized test.
***** Attribute 'name': names the particular test, see howExpensiveIs.cpp for details
***** Attribute 'standardizedTime': The SieveTest by definition has a standardized test of 1, it runs a prime number sieve as a benchmark. All other standardizedTimes are normalized against this value.
***** Attribute 'realDuration': the actual duration, in seconds, of the test.
***** Attribute 'marginOfError': the amount +/- error for the real duration. Gives an idea of how much variability was in the test.
***** Attribute 'iterations': gives the total number of iterations run.
**** Element <icuSystemParams>: This element gives the full details of the target platform, in the XML format produced by the 'icuinfo' tool. The contents are informative only and not documented here.
* Analysis
** The data shows that, for example, parsing a number and opening the GB18030 converter are about the same cost. It also shows that opening a number formatter is about 60 times as expensive as formatting a number.
** Appendix II shows a .CSV (spreadsheet) file which shows analysis of a sample run between different systems.
** The Variation column for each Target system was calculated with the formula: "(Control-Target)/Control" where Control and Target are the standardized times for the Control and Target systems, respectively.
* Appendices
** Appendix I: Sample File
<?xml version="1.0" encoding="UTF-8" ?>
<tests icu="49.0.2">
<!-- Copyright (C) 2011, International Business Machines Corporation and others. All Rights Reserved. -->
<test name="SieveTest" standardizedTime="1.000000" realDuration="0.022804" marginOfError="0.000073" iterations="1000000" />
<test name="NullTest" standardizedTime="0.000017" realDuration="0.000000" marginOfError="0.000000" iterations="1000000" />
<test name="NumParseTest" standardizedTime="77.869922" realDuration="1.775721" marginOfError="0.011742" iterations="1000000" />
<test name="Test_unum_opendefault" standardizedTime="4855.974258" realDuration="110.734117" marginOfError="0.057131" iterations="1000000" />
<test name="Test_ucnv_opengb18030" standardizedTime="70.488403" realDuration="1.607395" marginOfError="0.009261" iterations="1000000" />
<icuSystemParams type="icu4c">
<param name="copyright"> Copyright (C) 2011, International Business Machines Corporation and others. All Rights Reserved. </param>
<param name="product">icu4c</param>
<param name="product.full">International Components for Unicode for C/C++</param>
<param name="version">49.0.2</param>
<param name="version.unicode">6.1</param>
<param name="platform.number">4000</param>
<param name="platform.type">Other (POSIX-like)</param>
<param name="locale.default">en_US</param>
<param name="locale.default.bcp47">en-US</param>
<param name="converter.default">UTF-8</param>
<param name="">icudt49l</param>
<param name="icudata.path">../../data/out/build/icudt49l</param>
<param name="cldr.version">21.0</param>
<param name="tz.version">2011n</param>
<param name="tz.default">America/Los_Angeles</param>
<param name="cpu.bits">64</param>
<param name="cpu.big_endian">0</param>
<param name="os.wchar_width">4</param>
<param name="os.charset_family">0</param>
<param name="">x86_64-unknown-linux-gnu</param>
<param name="">x86_64-unknown-linux-gnu</param>
<param name="">gcc</param>
<param name="build.cxx">g++</param>
** Appendix II: Analysis.csv,"""Control"", linux i7
Intel(R) Core(TM) i7-2720QM CPU @ 2.20GHz",MacBook 2.4ghz (Core2D),MacBook 2GhzCore2,AIX Power,MB 2.4 Variance,MB 2 variance,AIX Variance
SieveTest (=1.0),1,1,1,1,0.00%,0.00%,0.00%
NullTest (=0.0),0,0,0,0.08,#DIV/0!,#DIV/0!,#DIV/0!
** Appendix III: Revision History
*** Feb 2012, ICU 49, srl: First revision