Browse Source

2003-12-17 Patrik Torstensson

	contextbound-perf.cs: Test performance of CBO in same context.

svn path=/trunk/mono/; revision=21287
Patrik Torstensson 22 years ago
parent
commit
cedaaa52e8
2 changed files with 20 additions and 2 deletions
  1. 17 0
      mono/benchmark/contextbound-perf.cs
  2. 3 2
      mono/benchmark/sbperf2.cs

+ 17 - 0
mono/benchmark/contextbound-perf.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Collections;
+using System.Runtime.Remoting;
+
+public class Bar : System.ContextBoundObject {
+}
+
+public class Driver {
+  public static void Main (string[] args) {
+	Bar b = new Bar();
+    
+	for (int i = 0; i != 30000000; i++)
+		if (!b.Equals (b))
+			Console.WriteLine ("error!!");
+  }
+}
+

+ 3 - 2
mono/benchmark/sbperf2.cs

@@ -4,10 +4,11 @@ namespace test {
 	public class Test {
 		public static int Main() {
 			StringBuilder sb = new StringBuilder ();
-			for (int i = 0; i < 500000; i++) {
+			for (int i = 0; i < 1000000; i++) {
    			   sb.Append ("hello");
                            sb.Append (" world!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
-                           sb.ToString ();
+                           string str = sb.ToString ();
+			   int len = str.Length;
 			   sb.Length = 0;
 			}