179
|
1 package jp.ac.u_ryukyu.ie.cr.tatsuki.jungle.test;
|
|
2
|
|
3 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.DefaultJungle;
|
|
4 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.JungleTree;
|
|
5 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.JungleTreeEditor;
|
|
6 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.DefaultNodePath;
|
|
7 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.DefaultTreeEditor;
|
|
8 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.traverser.DefaultTraverser;
|
|
9 import org.xml.sax.SAXException;
|
|
10
|
|
11 import javax.xml.parsers.ParserConfigurationException;
|
|
12 import java.io.*;
|
|
13 import java.nio.ByteBuffer;
|
|
14
|
|
15 /**
|
|
16 * Created by e115731 on 15/03/17.
|
|
17 */
|
|
18 public class TreeMapBenchMark {
|
|
19 public static void main(String[] args) throws InterruptedException, IOException, ParserConfigurationException, SAXException {
|
|
20 System.out.println("startReadTree");
|
|
21
|
|
22 System.out.println("util");
|
|
23 Runtime rt = Runtime.getRuntime();
|
|
24 int cpuNum = rt.availableProcessors();
|
|
25
|
|
26 File file = new File("./readTreeMapTime");
|
|
27 PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter(file)));
|
|
28 for (int THREAD_COUNT = 1; THREAD_COUNT <= cpuNum; THREAD_COUNT++) {
|
|
29 TreeMapReadThread readThread[] = new TreeMapReadThread[THREAD_COUNT];
|
|
30 ;
|
|
31 for (int count = 0; THREAD_COUNT > count; count++) {
|
|
32 readThread[count] = new TreeMapReadThread();
|
|
33 }
|
|
34
|
|
35 for (int count = 0; THREAD_COUNT > count; count++) {
|
|
36 readThread[count].start();
|
|
37 }
|
|
38
|
|
39 System.out.println("StartThread");
|
|
40
|
|
41 Thread.sleep(1000);
|
|
42 long readCount = 0;
|
|
43
|
|
44 for (int count = 0; THREAD_COUNT > count; count++) {
|
|
45 readCount = readCount + readThread[count].getFindCount();
|
|
46 readThread[count].set(false);
|
|
47 }
|
|
48
|
|
49 pw.println(THREAD_COUNT + " " + readCount);
|
|
50 System.out.println(THREAD_COUNT + "readCount = " + readCount);
|
|
51 }
|
|
52
|
|
53 pw.close();
|
|
54 }
|
|
55
|
|
56 }
|