dotgnu-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [DotGNU]Could someone test this on all platforms ?


From: Paolo Molaro
Subject: Re: [DotGNU]Could someone test this on all platforms ?
Date: Fri, 7 Feb 2003 12:18:21 +0100
User-agent: Mutt/1.4i

On 02/07/03 Gopal V wrote:
> > C:\cygwin\home\abansod>looper.exe
> > 0 Milliseconds
> 
> hrmm.. deadcode removal :)
> 
> My tests with mono JIT have been surprising ... with ilrun outperforming
> it by a factor of 8 to 12 consistently . I wanted to confirm that the 
> issue was not with CSCC generated code.

I guess in the computer science courses they don't teach how measuring is
supposed to be done? ;-)
Two tips that I remember from the long years I spent studying chemistry
are:
1) make sure the measurement doesn't interfere with the quantity you
want to measure (or at least take the effect into account)
2) the resolution of the tool you use to measure needs to be adequate
with the dimension of the thing you want to measure

Your test case has both issues:
1) the first DateTime.Now call will make the jit compile lots of methods
(initialization of some types and so on). I guess writing the DateTime
code in a different way could reduce the number of methods compiled.
Anyway, you can avoid the effect of this by discarding the first result
from DateTime.Now and calling it another time, when all the needed
methods are already jitted.

2) the Millisecond property has, well, a millisecond resolution:-)
Measuring something that is in the order of a millisecond execution time
is going to give very imprecise results.

I just added a "t1=DateTime.Now;" before the loop and increased the
number of iterations to 10240000. Results are below:

$ time mono silly.exe 
327 Milliseconds

real 0m0.453s

$ time ilrun silly.exe 
759 Milliseconds

real 0m0.826s

$ time mono a.out.exe 
326 Milliseconds

real 0m0.451s

$ time ilrun a.out.exe 
855 Milliseconds

real 0m0.924s

silly.exe was compiled with mcs, a.out.exe with cscc.
Note that the cscc program is significantly slower with ilrun.
I had to run ilrun several times to get a positive result for
Millisecond (this sometimes happens with mono, too, but less often,
didn't look at what could cause this). Anyway, it looks like ilrun is 
about two times slower than mono in your test.

Cheers.

lupus

-- 
-----------------------------------------------------------------
address@hidden                                     debian/rules
address@hidden                             Monkeys do it better


reply via email to

[Prev in Thread] Current Thread [Next in Thread]