2003-12-17 Patrik Torstensson
authorPatrik Torstensson <totte@mono-cvs.ximian.com>
Wed, 17 Dec 2003 17:27:38 +0000 (17:27 -0000)
committerPatrik Torstensson <totte@mono-cvs.ximian.com>
Wed, 17 Dec 2003 17:27:38 +0000 (17:27 -0000)
contextbound-perf.cs: Test performance of CBO in same context.

svn path=/trunk/mono/; revision=21287

mono/benchmark/contextbound-perf.cs [new file with mode: 0644]
mono/benchmark/sbperf2.cs

diff --git a/mono/benchmark/contextbound-perf.cs b/mono/benchmark/contextbound-perf.cs
new file mode 100644 (file)
index 0000000..848ee52
--- /dev/null
@@ -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!!");
+  }
+}
+
index 27c8f34c70421fe14e305ac7a84517728240fe17..8d7379e4ea95b25a181d8221194bd8b004d2ce2d 100644 (file)
@@ -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;
                        }