changeset 14:047bbe894005

add TreeMapTime
author one
date Sat, 06 Dec 2014 12:00:21 +0900
parents 7c544969d4c9
children 89478f2ea07f
files pom.xml src/main/java/jp/ac/u_ryukyu/ie/cr/tatsuki/xml/FJTreeMapSetTime.java src/main/java/jp/ac/u_ryukyu/ie/cr/tatsuki/xml/UntilTreeMapPutTime.java
diffstat 3 files changed, 89 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/pom.xml	Wed Nov 26 13:00:26 2014 +0900
+++ b/pom.xml	Sat Dec 06 12:00:21 2014 +0900
@@ -1,33 +1,35 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-  <groupId>jungle-bench</groupId>
-  <artifactId>jungle-bench</artifactId>
-  <version>0.0.1-SNAPSHOT</version>
-  <build>
-    <sourceDirectory>src/main/java</sourceDirectory>
-     <testSourceDirectory>src/test/java</testSourceDirectory>
-    <plugins>
-      <plugin>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <version>2.3.2</version>
-        <configuration>
-          <source>1.7</source>
-          <target>1.7</target>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-    <dependencies>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>jungle-bench</groupId>
+	<artifactId>jungle-bench</artifactId>
+	<version>0.0.1-SNAPSHOT</version>
+	<build>
+		<sourceDirectory>src/main/java</sourceDirectory>
+		<testSourceDirectory>src/test/java</testSourceDirectory>
+		<plugins>
+			<plugin>
+				<artifactId>maven-compiler-plugin</artifactId>
+				<version>2.3.2</version>
+				<configuration>
+					<source>1.7</source>
+					<target>1.7</target>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+	<dependencies>
 
-  <dependency>
-  		<groupId>jungle</groupId>
-  		<artifactId>jungle-core</artifactId>
-  		<version>0.0.3-SNAPSHOT</version>
-  	</dependency>
-  <dependency>
-  	<groupId>junit</groupId>
-  	<artifactId>junit</artifactId>
-  	<version>4.7</version>
-  </dependency>
-    </dependencies>
+		<dependency>
+			<groupId>org.functionaljava</groupId>
+			<artifactId>functionaljava</artifactId>
+			<version>4.1</version>
+		</dependency>
+
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>4.7</version>
+		</dependency>
+	</dependencies>
 </project>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/tatsuki/xml/FJTreeMapSetTime.java	Sat Dec 06 12:00:21 2014 +0900
@@ -0,0 +1,30 @@
+package jp.ac.u_ryukyu.ie.cr.tatsuki.xml;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import fj.Ord;
+import fj.data.TreeMap;
+
+public class FJTreeMapSetTime {
+  public static void main(String args[]) throws IOException {
+    File file = new File("./time/newfj41");
+    PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter(file)));
+    TreeMap<Integer, Integer> map = TreeMap.empty(Ord.intOrd);
+    long t1 = 0;
+    long t2 = 0;
+    for (int count = 0; count <= 30000; count++) {
+      t1 = System.currentTimeMillis();
+      map = map.set(count, count);
+      t2 = System.currentTimeMillis();
+      if (count % 100 == 0) {
+        System.out.println("put time " + count + " " + (t2 - t1));
+        pw.println(count + " " + (t2 - t1));
+      }
+    }
+    pw.close();
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/tatsuki/xml/UntilTreeMapPutTime.java	Sat Dec 06 12:00:21 2014 +0900
@@ -0,0 +1,26 @@
+package jp.ac.u_ryukyu.ie.cr.tatsuki.xml;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.TreeMap;
+
+
+public class UntilTreeMapPutTime {
+
+  public static void main(String args[]) throws IOException {
+    File file = new File("./time/until");
+    PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter(file)));
+    TreeMap<Integer, Integer> map = new TreeMap<Integer,Integer>();
+    for (int count = 0; count <= 48800; count++) {
+      long t1 = System.currentTimeMillis();
+      map.put(count, count);
+      long t2 = System.currentTimeMillis();
+      System.out.println("put time " + count + " " + (t2 - t1));
+      pw.println(count + " " + (t2 - t1));
+    }
+    pw.close();
+  }
+}