Mercurial > hg > Members > tatsuki > JungleXMLReader
comparison src/main/java/ac/jp/u_ryukyu/cr/ie/tatsuki/time/TimeMeasurementJuGrix.java @ 40:59a7d2cffc86
add timeMeasurementJuGrix
author | one |
---|---|
date | Thu, 13 Nov 2014 23:34:41 +0900 |
parents | |
children | c036d36c33af |
comparison
equal
deleted
inserted
replaced
39:22edfb7f47ad | 40:59a7d2cffc86 |
---|---|
1 package ac.jp.u_ryukyu.cr.ie.tatsuki.time; | |
2 | |
3 import java.util.LinkedList; | |
4 import java.util.Random; | |
5 | |
6 import jp.ac.u_ryukyu.cr.ie.tatsuki.bbs.JuGrix; | |
7 | |
8 public class TimeMeasurementJuGrix { | |
9 | |
10 static int roopCount = 1000; | |
11 | |
12 public static void main(String args[]) { | |
13 | |
14 JuGrix jugrix = new JuGrix(false); | |
15 System.out.println("start : no index"); | |
16 | |
17 String orgId = "o:2"; | |
18 String personId = "p:1"; | |
19 LinkedList<String> filterIds = new LinkedList<String>(); | |
20 filterIds.add("r:5"); | |
21 functions(jugrix, orgId, personId, filterIds); | |
22 | |
23 long sumTime = 0; | |
24 for (int count = 0; count < roopCount; count++) { | |
25 Random random = new Random(); | |
26 int ran = random.nextInt(30); | |
27 orgId = "o:" + String.valueOf(ran); | |
28 personId = "p:" + String.valueOf(ran); | |
29 long t1 = System.currentTimeMillis(); | |
30 functions(jugrix, orgId, personId, filterIds); | |
31 long t2 = System.currentTimeMillis(); | |
32 // System.out.println(count + "回目=" + (t2 - t1) + "s"); | |
33 sumTime = sumTime + t2 - t1; | |
34 } | |
35 System.out.println("合計 = " + sumTime + "s"); | |
36 System.out.println("end"); | |
37 | |
38 jugrix = new JuGrix(true); | |
39 functions(jugrix, orgId, personId, filterIds); | |
40 System.out.println("start : use index"); | |
41 sumTime = 0; | |
42 | |
43 for (int count = 0; count < roopCount; count++) { | |
44 Random random = new Random(); | |
45 int ran = random.nextInt(30); | |
46 orgId = "o:" + String.valueOf(ran); | |
47 personId = "p:" + String.valueOf(ran); | |
48 long t1 = System.currentTimeMillis(); | |
49 functions(jugrix, orgId, personId, filterIds); | |
50 long t2 = System.currentTimeMillis(); | |
51 //System.out.println(count + "回目=" + (t2 - t1) + "s"); | |
52 sumTime = sumTime + t2 - t1; | |
53 } | |
54 System.out.println("合計 = " + sumTime + "s"); | |
55 System.out.println("end"); | |
56 } | |
57 | |
58 private static void functions(JuGrix jugrix, String orgId, String personId, LinkedList<String> filterIds) { | |
59 jugrix.childOrganizationIds(orgId, filterIds); | |
60 jugrix.competentRoleId(personId); | |
61 jugrix.concurrentRoleIds(personId); | |
62 jugrix.deepChildOrganizationIds(orgId, filterIds); | |
63 jugrix.deepChildOrganizationIdsPlus(orgId, filterIds); | |
64 jugrix.deepParentOrganizationIds(orgId, filterIds); | |
65 jugrix.deepParentOrganizationIdsPlus(orgId, filterIds); | |
66 jugrix.deepPersonIds(orgId, filterIds); | |
67 jugrix.isActive(personId); | |
68 jugrix.parentOrganizationIds(orgId, filterIds); | |
69 jugrix.personIds(orgId, filterIds); | |
70 jugrix.roleDescriptionElementIds(orgId, filterIds); | |
71 jugrix.roleIds(orgId); | |
72 jugrix.rolePriority(personId, "r:34"); | |
73 jugrix.stringPathToId("r:path:エスアールエルテクノシステム/臨検システム部/業務システムグループ"); | |
74 } | |
75 } |