]>
Commit | Line | Data |
---|---|---|
46f4442e | 1 | #!/usr/bin/perl |
374ca955 | 2 | # ******************************************************************** |
f3c0d7a5 A |
3 | # * Copyright (C) 2016 and later: Unicode, Inc. and others. |
4 | # *License & terms of use: http://www.unicode.org/copyright.html#License | |
5 | # ******************************************************************** | |
6 | # ******************************************************************** | |
374ca955 | 7 | # * COPYRIGHT: |
57a6839d | 8 | # * Copyright (c) 2003-2013, International Business Machines Corporation and |
374ca955 A |
9 | # * others. All Rights Reserved. |
10 | # ******************************************************************** | |
11 | ||
12 | ||
46f4442e A |
13 | #use strict; |
14 | ||
15 | require "../perldriver/Common.pl"; | |
374ca955 A |
16 | |
17 | use lib '../perldriver'; | |
18 | ||
19 | use PerfFramework; | |
20 | ||
21 | my $options = { | |
57a6839d A |
22 | "title"=>"Unicode String performance: ICU ".$ICULatestVersion." vs. STDLib", |
23 | "headers"=>"StdLib ICU".$ICULatestVersion, | |
24 | "operationIs"=>"Unicode String", | |
25 | "timePerOperationIs"=>"Time per Unicode String", | |
26 | "passes"=>"5", | |
27 | "time"=>"2", | |
28 | #"outputType"=>"HTML", | |
29 | "dataDir"=>$CollationDataPath, | |
30 | "outputDir"=>"../results" | |
31 | }; | |
374ca955 A |
32 | |
33 | ||
34 | # programs | |
35 | # tests will be done for all the programs. Results will be stored and connected | |
46f4442e A |
36 | my $p; |
37 | if ($OnWindows) { | |
57a6839d | 38 | $p = "cd ".$ICULatest."/bin && ".$ICUPathLatest."/ustrperf/$WindowsPlatform/Release/stringperf.exe -l -u"; |
46f4442e | 39 | } else { |
57a6839d | 40 | $p = "LD_LIBRARY_PATH=".$ICULatest."/source/lib:".$ICULatest."/source/tools/ctestfw ".$ICUPathLatest."/ustrperf/stringperf -l -u"; |
46f4442e | 41 | } |
374ca955 A |
42 | |
43 | my $tests = { | |
57a6839d A |
44 | "Object Construction(empty string)", ["$p,TestStdLibCtor" , "$p,TestCtor" ], |
45 | "Object Construction(single char)", ["$p,TestStdLibCtor1" , "$p,TestCtor1" ], | |
46 | "Object Construction(another string)", ["$p,TestStdLibCtor2" , "$p,TestCtor2" ], | |
47 | "Object Construction(string literal)", ["$p,TestStdLibCtor3" , "$p,TestCtor3" ], | |
48 | "String Assignment(helper)", ["$p,TestStdLibAssign" , "$p,TestAssign" ], | |
49 | "String Assignment(string literal)", ["$p,TestStdLibAssign1" , "$p,TestAssign1" ], | |
50 | "String Assignment(another string)", ["$p,TestStdLibAssign2" , "$p,TestAssign2" ], | |
51 | "Get String or Character", ["$p,TestStdLibGetch" , "$p,TestGetch" ], | |
52 | "Concatenation", ["$p,TestStdLibCatenate" , "$p,TestCatenate" ], | |
53 | "String Scanning(char)", ["$p,TestStdLibScan" , "$p,TestScan" ], | |
54 | "String Scanning(string)", ["$p,TestStdLibScan1" , "$p,TestScan1" ], | |
55 | "String Scanning(char set)", ["$p,TestStdLibScan2" , "$p,TestScan2" ], | |
374ca955 A |
56 | }; |
57 | ||
58 | my $dataFiles = { | |
57a6839d A |
59 | "", |
60 | [ | |
61 | "TestNames_Asian.txt", | |
62 | "TestNames_Chinese.txt", | |
63 | "TestNames_Simplified_Chinese.txt", | |
64 | "TestNames_Japanese_h.txt", | |
65 | "TestNames_Japanese_k.txt", | |
66 | "TestNames_Korean.txt", | |
67 | "TestNames_Latin.txt", | |
68 | "TestNames_SerbianSH.txt", | |
69 | "TestNames_SerbianSR.txt", | |
70 | "TestNames_Thai.txt", | |
71 | "Testnames_Russian.txt", | |
72 | "th18057.txt", | |
73 | ] | |
74 | }; | |
374ca955 A |
75 | |
76 | runTests($options, $tests, $dataFiles); | |
77 | ||
78 | # The whole command line would be something like: | |
f3c0d7a5 | 79 | # stringperf.exe -p 5 -t 2 -f c:/src/data/perf/TestNames_Asian.txt -l -u TestStdLibCatenate |