axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dasar...@apache.org
Subject svn commit: r123805 - webservices/axis/trunk/java/dev/scratch/dasarath/om/$1
Date Fri, 31 Dec 2004 16:04:39 GMT
Author: dasarath
Date: Fri Dec 31 08:04:38 2004
New Revision: 123805

URL: http://svn.apache.org/viewcvs?view=rev&rev=123805
Log:

Added:
   webservices/axis/trunk/java/dev/scratch/dasarath/om/$1/
   webservices/axis/trunk/java/dev/scratch/dasarath/om/$1/.classpath
   webservices/axis/trunk/java/dev/scratch/dasarath/om/$1/.project
   webservices/axis/trunk/java/dev/scratch/dasarath/om/$1/ALElement.class   (contents, props
changed)
   webservices/axis/trunk/java/dev/scratch/dasarath/om/$1/ALElement.java
   webservices/axis/trunk/java/dev/scratch/dasarath/om/$1/LLElement.class   (contents, props
changed)
   webservices/axis/trunk/java/dev/scratch/dasarath/om/$1/LLElement.java
   webservices/axis/trunk/java/dev/scratch/dasarath/om/$1/README
   webservices/axis/trunk/java/dev/scratch/dasarath/om/$1/Tester.class   (contents, props
changed)
   webservices/axis/trunk/java/dev/scratch/dasarath/om/$1/Tester.java

Added: webservices/axis/trunk/java/dev/scratch/dasarath/om/$1/.classpath
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/dasarath/om/%241/.classpath?view=auto&rev=123805
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/dasarath/om/$1/.classpath	Fri Dec 31 08:04:38
2004
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+    <classpathentry kind="src" path=""/>
+    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+    <classpathentry kind="output" path=""/>
+</classpath>

Added: webservices/axis/trunk/java/dev/scratch/dasarath/om/$1/.project
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/dasarath/om/%241/.project?view=auto&rev=123805
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/dasarath/om/$1/.project	Fri Dec 31 08:04:38 2004
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>$2</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Added: webservices/axis/trunk/java/dev/scratch/dasarath/om/$1/ALElement.class
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/dasarath/om/%241/ALElement.class?view=auto&rev=123805
==============================================================================
Binary file. No diff available.

Added: webservices/axis/trunk/java/dev/scratch/dasarath/om/$1/ALElement.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/dasarath/om/%241/ALElement.java?view=auto&rev=123805
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/dasarath/om/$1/ALElement.java	Fri Dec 31 08:04:38
2004
@@ -0,0 +1,40 @@
+import java.util.ArrayList;
+import java.util.Iterator;
+
+/*
+ * Created on Dec 30, 2004
+ *
+ * To change the template for this generated file go to
+ * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
+ */
+
+/**
+ * @author Dasarath
+ *
+ * @date Dec 30, 2004
+ */
+public class ALElement {
+	ArrayList al;
+	public static final int S= 100;
+	
+	public ALElement() {
+		al= new ArrayList(S);
+	}
+
+	public void addChild(ALElement child) {
+		al.add(child);		
+	}
+	
+	public ALElement traverse(){
+		ALElement e= null;
+		
+		Iterator iter= al.iterator();
+		while (iter.hasNext())
+			e= (ALElement)iter.next();
+
+/*		int n= al.size();
+		for (int i= 0; i < n; i++)
+			e= (ALElement)al.get(i);
+*/		return e;
+	}
+}

Added: webservices/axis/trunk/java/dev/scratch/dasarath/om/$1/LLElement.class
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/dasarath/om/%241/LLElement.class?view=auto&rev=123805
==============================================================================
Binary file. No diff available.

Added: webservices/axis/trunk/java/dev/scratch/dasarath/om/$1/LLElement.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/dasarath/om/%241/LLElement.java?view=auto&rev=123805
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/dasarath/om/$1/LLElement.java	Fri Dec 31 08:04:38
2004
@@ -0,0 +1,37 @@
+/*
+ * Created on Dec 30, 2004
+ *
+ */
+
+/**
+ * @author Dasarath
+ *
+ * @date Dec 30, 2004
+ */
+public class LLElement {
+	LLElement nextSib, prevSib, firstChild;
+
+	public LLElement() {
+		firstChild= null;
+		nextSib= null;
+		prevSib= null;
+	}
+
+	public void addChild(LLElement child) {
+		child.prevSib= null;		
+		if (firstChild == null)
+			child.nextSib= null;			
+		else {		
+			child.nextSib= firstChild;
+			firstChild.prevSib= child;
+		}
+		firstChild= child;
+	}
+	
+	public LLElement traverse(){
+		LLElement e= firstChild;
+		while (e.nextSib != null)
+			e= e.nextSib;
+		return e;		
+	}
+}

Added: webservices/axis/trunk/java/dev/scratch/dasarath/om/$1/README
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/dasarath/om/%241/README?view=auto&rev=123805
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/dasarath/om/$1/README	Fri Dec 31 08:04:38 2004
@@ -0,0 +1,24 @@
+diff/currentTimeMillis
+
+impl						N			M			T			S			diff
+-------------------------------------------------------------------------------------
+LLElement(test1)			200			100			10000					1
+
+ALElement(test2)												1			11		traverse/Object get(int index)
+																5			11
+																100			11
+																
+																1			35		traverse/Iterator iterator()
+																5			35
+																100			35											
+-------------------------------------------------------------------------------------
+LLElement(test1)			200			10000		100						6
+
+ALElement(test2)												1			21		traverse/Object get(int index)
+																5			26
+																100			49
+																		
+																1			45		traverse/Iterator iterator()
+																5			50
+																100			72										
+-------------------------------------------------------------------------------------

Added: webservices/axis/trunk/java/dev/scratch/dasarath/om/$1/Tester.class
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/dasarath/om/%241/Tester.class?view=auto&rev=123805
==============================================================================
Binary file. No diff available.

Added: webservices/axis/trunk/java/dev/scratch/dasarath/om/$1/Tester.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/dasarath/om/%241/Tester.java?view=auto&rev=123805
==============================================================================
--- (empty file)
+++ webservices/axis/trunk/java/dev/scratch/dasarath/om/$1/Tester.java	Fri Dec 31 08:04:38
2004
@@ -0,0 +1,47 @@
+/*
+ * Created on Dec 30, 2004
+ *
+ */
+
+/**
+ * @author Dasarath
+ *
+ * @date Dec 30, 2004
+ */
+public class Tester {
+	public static final long N= 200;
+	public static final long M= 10000;
+	public static final long T= 100;
+	void test1() throws Exception {
+		for (int i= 0; i < N; i++) {
+			LLElement e= new LLElement();
+			for (int j= 0; j < M; j++)
+				e.addChild(new LLElement());
+			for (int k= 0; k < T; k++)
+				e.traverse();			
+		}
+	}
+
+	void test2() throws Exception {
+		for (int i= 0; i < N; i++) {
+			ALElement e= new ALElement();
+			for (int j= 0; j < M; j++)
+				e.addChild(new ALElement());
+			for (int k= 0; k < T; k++)
+				e.traverse();
+		}
+	}
+
+	public static void main(String[] args) {
+		try {
+			long t1= System.currentTimeMillis();
+			new Tester().test2();
+			long t2= System.currentTimeMillis();
+			System.out.println((t2 - t1)/N);
+		}
+		catch (Exception e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+	}
+}

Mime
View raw message