* mono/benchmark/pinvoke.cs: New benchmark for testing the performance
of the managed/unmanaged boundary.
svn path=/trunk/mono/; revision=19695
+2003-11-06 Zoltan Varga <zovarga@ws-zovarga2>
+
+ * mono/benchmark/pinvoke.cs: New benchmark for testing the performance
+ of the managed/unmanaged boundary.
+
2003-11-06 Zoltan Varga <vargaz@freemail.hu>
* configure.in acconfig.h: Add check for __thread keyword in gcc.
--- /dev/null
+using System;
+using System.Runtime.InteropServices;
+
+public class Test {
+
+ public static int delegate_test (int a)
+ {
+ if (a == 2)
+ return 0;
+
+ return 1;
+ }
+
+ [DllImport ("libtest", EntryPoint="mono_test_empty_pinvoke")]
+ public static extern int mono_test_empty_pinvoke (int i);
+
+ public static int Main (String[] args) {
+ int repeat = 1;
+
+ if (args.Length == 1)
+ repeat = Convert.ToInt32 (args [0]);
+
+ Console.WriteLine ("Repeat = " + repeat);
+
+ for (int i = 0; i < (repeat * 5000); i++)
+ for (int j = 0; j < 10000; j++)
+ mono_test_empty_pinvoke (5);
+
+ return 0;
+ }
+}