From cedaaa52e8d2feff1deeac3f4fb39023df26ba97 Mon Sep 17 00:00:00 2001 From: Patrik Torstensson Date: Wed, 17 Dec 2003 17:27:38 +0000 Subject: [PATCH] 2003-12-17 Patrik Torstensson contextbound-perf.cs: Test performance of CBO in same context. svn path=/trunk/mono/; revision=21287 --- mono/benchmark/contextbound-perf.cs | 17 +++++++++++++++++ mono/benchmark/sbperf2.cs | 5 +++-- 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 mono/benchmark/contextbound-perf.cs diff --git a/mono/benchmark/contextbound-perf.cs b/mono/benchmark/contextbound-perf.cs new file mode 100644 index 00000000000..848ee52e574 --- /dev/null +++ b/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!!"); + } +} + diff --git a/mono/benchmark/sbperf2.cs b/mono/benchmark/sbperf2.cs index 27c8f34c704..8d7379e4ea9 100644 --- a/mono/benchmark/sbperf2.cs +++ b/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; } -- 2.25.1