1#!/usr/bin/perl
2#  ********************************************************************
3#  * COPYRIGHT:
4#  * Copyright (c) 2008-2013, International Business Machines
5#  * Corporation and others. All Rights Reserved.
6#  ********************************************************************
7
8#use strict;
9
10require "../perldriver/Common.pl";
11
12use lib '../perldriver';
13
14use PerfFramework;
15
16my $options = {
17    "title" => "String search performance regression: ICU ("
18      . $ICUPreviousVersion . " and "
19      . $ICULatestVersion . ")",
20    "headers"     => "ICU" . $ICUPreviousVersion . " ICU" . $ICULatestVersion,
21    "operationIs" => "code point",
22    "timePerOperationIs" => "Time per code point",
23    "passes"             => "10",
24    "time"               => "5",
25
26    #"outputType"=>"HTML",
27    "dataDir"   => $UDHRDataPath,
28    "outputDir" => "../results"
29};
30
31# programs
32
33my $p1;    # Previous
34my $p2;    # Latest
35
36if ($OnWindows) {
37    $p1 = "cd ".$ICUPrevious."/bin && ".$ICUPathPrevious . "/strsrchperf/$WindowsPlatform/Release/strsrchperf.exe -b";
38    $p2 = "cd ".$ICULatest."/bin && ".$ICUPathLatest . "/strsrchperf/$WindowsPlatform/Release/strsrchperf.exe -b";
39}
40else {
41    $p1 = "LD_LIBRARY_PATH=".$ICUPrevious."/source/lib:".$ICUPrevious."/source/tools/ctestfw ".$ICUPathPrevious . "/strsrchperf/strsrchperf -b";
42    $p2 = "LD_LIBRARY_PATH=".$ICULatest."/source/lib:".$ICULatest."/source/tools/ctestfw ".$ICUPathLatest . "/strsrchperf/strsrchperf -b";
43}
44
45my $dataFiles = {
46    "en" => ["udhr_eng.txt"],
47    "de" => ["udhr_deu_1996.txt"],
48    "fr" => ["udhr_fra.txt"],
49    "ru" => ["udhr_rus.txt"],
50    "th" => ["udhr_tha.txt"],
51    "ja" => ["udhr_jpn.txt"],
52    "zh" => ["udhr_cmn_hans.txt"],
53};
54
55my $tests = {
56    "ICU Forward Search", [ "$p1 Test_ICU_Forward_Search", "$p2 Test_ICU_Forward_Search" ],
57    "ICU Backward Search",[ "$p1 Test_ICU_Backward_Search", "$p2 Test_ICU_Backward_Search" ],
58};
59
60runTests( $options, $tests, $dataFiles );
61
62
63