]> git.saurik.com Git - apple/icu.git/blame - icuSources/test/perf/collperf/CollPerf.pl
ICU-66108.tar.gz
[apple/icu.git] / icuSources / test / perf / collperf / CollPerf.pl
CommitLineData
46f4442e 1#!/usr/bin/perl
73c04bcf 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# ********************************************************************
73c04bcf 7# * COPYRIGHT:
57a6839d 8# * Copyright (c) 2005-2013, International Business Machines Corporation and
73c04bcf
A
9# * others. All Rights Reserved.
10# ********************************************************************
11
46f4442e 12#use strict;
73c04bcf
A
13
14use lib '../perldriver';
15
46f4442e
A
16require "../perldriver/Common.pl";
17
73c04bcf
A
18use PerfFramework;
19
73c04bcf 20my $options = {
57a6839d
A
21 "title"=>"Collation performance: ICU,POSIX,and Win",
22 "headers"=>"ICU POSIX WIN",
23 "operationIs"=>"unicode String",
24 "passes"=>"1",
25 "time"=>"2",
26 #"outputType"=>"HTML",
27 "dataDir"=>$CollationDataPath,
28 "outputDir"=>"../results"
29};
73c04bcf 30
51004dcb
A
31my $p;
32if ($OnWindows) {
57a6839d 33 $p = "cd ".$ICULatest."/bin && ".$ICUPathLatest."/collperf/$WindowsPlatform/Release/collperf.exe";
51004dcb 34} else {
57a6839d 35 $p = "LD_LIBRARY_PATH=".$ICULatest."/source/lib:".$ICULatest."/source/tools/ctestfw ".$ICUPathLatest."/collperf/collperf";
51004dcb
A
36}
37
73c04bcf
A
38# programs
39# tests will be done for all the programs. Results will be stored and connected
51004dcb
A
40my $test;
41if ($OnWindows) {
57a6839d
A
42 $tests = {
43 "Key Gen null", ["$p,TestIcu_KeyGen_null", "$p,TestPosix_KeyGen_null", "$p,TestWin_KeyGen_null"],
44 "qsort strcoll null", ["$p,TestIcu_qsort_strcoll_null", "$p,TestPosix_qsort_strcoll_null", "$p,TestWin_qsort_CompareStringW_null"],
45 "qsort use key", ["$p,TestIcu_qsort_usekey", "$p,TestPosix_qsort_usekey", "$p,TestWin_qsort_usekey"],
46 "Binary Search icu strcoll null", ["$p,TestIcu_BinarySearch_strcoll_null", "$p,TestPosix_BinarySearch_strcoll_null", "$p,TestWin_BinarySearch_CompareStringW_null"],
47 "Binary Search icu use key", ["$p,TestIcu_BinarySearch_usekey", "$p,TestPosix_BinarySearch_usekey", "$p,TestWin_BinarySearch_usekey"],
48 # These are the original test. They are commented out to so that the above test can run and compare certain aspects of collation.
49 #"Key Gen ICU null", ["$p,TestIcu_KeyGen_null"],
50 #"Key Gen ICU len", ["$p,TestIcu_KeyGen_len"],
51 #"Key Gen POSIX", ["$p,TestPosix_KeyGen_null"],
52 #"Key Gen Win", ["$p,TestWin_KeyGen_null"],
53 #"Iteration icu forward null", ["$p,TestIcu_ForwardIter_null"],
54 #"Iteration icu forward len", ["$p,TestIcu_ForwardIter_len"],
55 #"Iteration icu backward null", ["$p,TestIcu_BackwardIter_null"],
56 #"Iteration icu backward len", ["$p,TestIcu_BackwardIter_len"],
57 #"Iteration/all icu forward null", ["$p,TestIcu_ForwardIter_all_null"],
58 #"Iteration/all icu forward len", ["$p,TestIcu_ForwardIter_all_len"],
59 #"Iteration/all icu backward null", ["$p,TestIcu_BackwardIter_all_null"],
60 #"Iteration/all icu backward len", ["$p,TestIcu_BackwardIter_all_len"],
61 #"qsort icu strcoll null", ["$p,TestIcu_qsort_strcoll_null"],
62 #"qsort icu strcoll len", ["$p,TestIcu_qsort_strcoll_len"],
63 #"qsort icu use key", ["$p,TestIcu_qsort_usekey"],
64 #"qsort posix strcoll null", ["$p,TestPosix_qsort_strcoll_null"],
65 #"qsort posix use key", ["$p,TestPosix_qsort_usekey"],
66 #"qsort win CompareStringW null", ["$p,TestWin_qsort_CompareStringW_null"],
67 #"qsort win CompareStringW len", ["$p,TestWin_qsort_CompareStringW_len"],
68 #"qsort win use key", ["$p,TestWin_qsort_usekey"],
69 #"Binary Search icu strcoll null", ["$p,TestIcu_BinarySearch_strcoll_null"],
70 #"Binary Search icu strcoll len", ["$p,TestIcu_BinarySearch_strcoll_len"],
71 #"Binary Search icu use key", ["$p,TestIcu_BinarySearch_usekey"],
72 #"Binary Search icu u_strcmp", ["$p,TestIcu_BinarySearch_strcmp"],
73 #"Binary Search icu cmpCPO", ["$p,TestIcu_BinarySearch_cmpCPO"],
74 #"Binary Search posix strcoll null", ["$p,TestPosix_BinarySearch_strcoll_null"],
75 #"Binary Search posix use key", ["$p,TestPosix_BinarySearch_usekey"],
76 #"Binary Search win CompareStringW null", ["$p,TestWin_BinarySearch_CompareStringW_null"],
77 #"Binary Search win CompareStringW len", ["$p,TestWin_BinarySearch_CompareStringW_len"],
78 #"Binary Search win use key", ["$p,TestWin_BinarySearch_usekey"],
79 #"Binary Search win wcscmp", ["$p,TestWin_BinarySearch_wcscmp"],
80 };
51004dcb 81} else {
57a6839d
A
82 $tests = {
83 "Key Gen null", ["$p,TestIcu_KeyGen_null", "$p,TestPosix_KeyGen_null"],
84 "qsort strcoll null", ["$p,TestIcu_qsort_strcoll_null", "$p,TestPosix_qsort_strcoll_null"],
85 "qsort use key", ["$p,TestIcu_qsort_usekey", "$p,TestPosix_qsort_usekey"],
86 "Binary Search icu strcoll null", ["$p,TestIcu_BinarySearch_strcoll_null", "$p,TestPosix_BinarySearch_strcoll_null"],
87 "Binary Search icu use key", ["$p,TestIcu_BinarySearch_usekey", "$p,TestPosix_BinarySearch_usekey"],
88 };
51004dcb 89}
73c04bcf
A
90
91my $dataFiles = {
57a6839d
A
92 "",
93 [
94 "TestNames_Asian.txt",
95 "TestNames_Chinese.txt",
96 "TestNames_Japanese.txt",
97 "TestNames_Japanese_h.txt",
98 "TestNames_Japanese_k.txt",
99 "TestNames_Korean.txt",
100 "TestNames_Latin.txt",
101 "TestNames_Russian.txt",
102 "TestNames_SerbianSH.txt",
103 "TestNames_SerbianSR.txt",
104 "TestNames_Simplified_Chinese.txt",
105 "TestNames_Thai.txt"
106 ]
107};
73c04bcf
A
108
109runTests($options, $tests, $dataFiles);