Home | History | Annotate | Download | only in ustrperf
      1 #!/usr/bin/perl
      2 #  ********************************************************************
      3 #  * Copyright (C) 2016 and later: Unicode, Inc. and others.
      4 #  *License & terms of use: http://www.unicode.org/copyright.html#License
      5 #  ********************************************************************
      6 #  ********************************************************************
      7 #  * COPYRIGHT:
      8 #  * Copyright (c) 2002-2013, International Business Machines
      9 #  * Corporation and others. All Rights Reserved.
     10 #  ********************************************************************
     11 
     12 #use strict;
     13 
     14 use lib '../perldriver';
     15 
     16 require "../perldriver/Common.pl";
     17 
     18 use PerfFramework;
     19 
     20 my $options = {
     21     "title"=>"Unicode String performance regression: ICU (".$ICUPreviousVersion." and ".$ICULatestVersion.")",
     22     "headers"=>"ICU".$ICUPreviousVersion." ICU".$ICULatestVersion,
     23     "operationIs"=>"Unicode String",
     24     "passes"=>"10",
     25     "time"=>"5",
     26     #"outputType"=>"HTML",
     27     "dataDir"=>$CollationDataPath,
     28     "outputDir"=>"../results"
     29 };
     30 
     31 # programs
     32 
     33 my $p1; # Previous
     34 my $p2; # Latest
     35 
     36 if ($OnWindows) {
     37     $p1 = "cd ".$ICUPrevious."/bin && ".$ICUPathPrevious."/ustrperf/$WindowsPlatform/Release/stringperf.exe -b -u"; # Previous
     38     $p2 = "cd ".$ICULatest."/bin && ".$ICUPathLatest."/ustrperf/$WindowsPlatform/Release/stringperf.exe -b -u"; # Latest
     39 } else {
     40     $p1 = "LD_LIBRARY_PATH=".$ICUPrevious."/source/lib:".$ICUPrevious."/source/tools/ctestfw ".$ICUPathPrevious."/ustrperf/stringperf -b -u"; # Previous
     41     $p2 = "LD_LIBRARY_PATH=".$ICULatest."/source/lib:".$ICULatest."/source/tools/ctestfw ".$ICUPathLatest."/ustrperf/stringperf -b -u"; # Latest
     42 }
     43 
     44 my $dataFiles = {
     45     "",
     46     [
     47         "TestNames_Asian.txt",
     48         "TestNames_Chinese.txt",
     49         "TestNames_Japanese.txt",
     50         "TestNames_Japanese_h.txt",
     51         "TestNames_Japanese_k.txt",
     52         "TestNames_Korean.txt",
     53         "TestNames_Latin.txt",
     54         "TestNames_SerbianSH.txt",
     55         "TestNames_SerbianSR.txt",
     56         "TestNames_Thai.txt",
     57         "Testnames_Russian.txt",
     58         "th18057.txt",
     59         "thesis.txt",
     60         "vfear11a.txt",
     61     ]
     62 };
     63 
     64 
     65 my $tests = { 
     66     "Object Construction(empty string)",      ["$p1,TestCtor"         , "$p2,TestCtor"         ],
     67     "Object Construction(single char)",       ["$p1,TestCtor1"        , "$p2,TestCtor1"        ],
     68     "Object Construction(another string)",    ["$p1,TestCtor2"        , "$p2,TestCtor2"        ],
     69     "Object Construction(string literal)",    ["$p1,TestCtor3"        , "$p2,TestCtor3"        ],
     70     "String Assignment(helper)",              ["$p1,TestAssign"       , "$p2,TestAssign"       ],
     71     "String Assignment(string literal)",      ["$p1,TestAssign1"      , "$p2,TestAssign1"      ],
     72     "String Assignment(another string)",      ["$p1,TestAssign2"      , "$p2,TestAssign2"      ],
     73     "Get String or Character",                ["$p1,TestGetch"        , "$p2,TestGetch"        ],
     74     "Concatenation",                          ["$p1,TestCatenate"     , "$p2,TestCatenate"     ],
     75     "String Scanning(char)",                  ["$p1,TestScan"         , "$p2,TestScan"         ],
     76     "String Scanning(string)",                ["$p1,TestScan1"        , "$p2,TestScan1"        ],
     77     "String Scanning(char set)",              ["$p1,TestScan2"        , "$p2,TestScan2"        ],
     78 };
     79 
     80 
     81 runTests($options, $tests, $dataFiles);
     82 
     83 
     84