[Mono-list] Re: Time problems on Mono

Martin Hansen mah@cfsi.dk
Mon, 13 Dec 2004 13:52:01 +0100

Gregory Bowyer wrote
> >   			for ( int n=3D0; n<=3D(1000* 1000 * 1000) ;n+=3D1 )
> >   	  		{
> > 				sum *=3D 1.0;
> > 			}
> Not meaning to flame but isn't that test a bit of a no brainer for=20
> performance issues, I mean its simply an aggressive loop that=20
> will take=20
> any langugage / platform a while to work through
No there is some obvius places for an optimizer. Whithout any
optimisazion a floating point opreration wll be preformed each tim the
loop iterates.
First an analysis of the expression will show that the variable isn't
changed. Secondly the variable is not referenced outside the loop so an
optimizert could remove the variable completely. So if the optimizer can
see just one of them it would speed up the loop a lot.
And aperantly ms-.net saw one them and mono did not.

but yes it is a very simple test.

Martin Hansen