[Mono-bugs] [Bug 80508][Nor] Changed - code quality regression for array init

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Mon Jan 15 06:53:32 EST 2007

Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by lupus at ximian.com.


--- shadow/80508	2007-01-14 16:04:52.000000000 -0500
+++ shadow/80508.tmp.3666	2007-01-15 06:53:32.000000000 -0500
@@ -88,6 +88,22 @@
 if (const_initializers_count > 8 && const_initializers_count >
 (array_data.Count >> 1) && TypeManager.IsPrimitiveType
 (array_element_type)) {
 	EmitStaticInitializers (ec);
+------- Additional Comments From lupus at ximian.com  2007-01-15 06:53 -------
+Please provide the test case that shows a 5x slowdown. In my tests
+with element counts from 12 to about 180, the ArrayInit method is
+about 30% slower in the worst case (on x86) and up to 80% _faster_
+(the worst case goes to 50% on ppc because of the need to swap
+With the jit optimization I mentioned the ArrayInit() is withing 2-3%
+in the worst cases (int array with count < 15 and long array with
+count < 25) and faster in all the other cases (while at the same time
+saving about 50 KB of generated native code). Of course I can improve
+the optimization to make it faster in all the cases, even with array
+element counts less than 5. And not only that: knowing the array is
+initialized allows us to allocate it in a faster way with the Boehm
+collector (avoiding the need of zeroing the data).

More information about the mono-bugs mailing list