Need code to compare speed of two computers. 
Author Message
 Need code to compare speed of two computers.

Does anyone have a suitable algorithim to tax a computer.
I need to compare the execution times on two machines.

I tried writing a for loop, but I think the compiler
is being too clever for its own good and optimising
the loop into nothingness.

I did:
for(i=0; i<1000000000l;i++)
{
        /*some random addition multiplication e.g.*/
        d=120302.0;
        d+=1000; d/=3.4565;

Quote:
}

Compiled with maximum optimisation this runs on an Ultra 30
in 5 seconds. I'm pretty sure that's too fast, so
I need some code which isn't so trivial.

Any thoughts?

kuda



Sun, 15 Jul 2001 03:00:00 GMT  
 Need code to compare speed of two computers.

Quote:

>Does anyone have a suitable algorithim to tax a computer.
>I need to compare the execution times on two machines.


there.

--
Craig

Manchester, NH
The label "man" has no connection to the act of providing
the syntax of a command, or in providing a discription of
a command.  -- Scott N*dds



Sun, 15 Jul 2001 03:00:00 GMT  
 Need code to compare speed of two computers.

Quote:

>Does anyone have a suitable algorithim to tax a computer.
>I need to compare the execution times on two machines.

Benchmarking computers properly is *really, really hard*. Honestly.
Your benchmark, even assuming the compiler didn't remove it
completely, would only look at some aspects of floating point
performance, ignoring disk and memory bandwidth, cache behaviour,
pipelining and a whole host of other issues which affect how fast
the computer is in real life. You might want to look at some
existing benchmark suites, such as SPEC (www.spec.org).
Alternatively, try the two computers on the application you really
want to do. Whatever you do, don't write some ten line
program and assume that it gives a true picture of the
machine's performance.

Quote:
>I did:
>for(i=0; i<1000000000l;i++)
>{
> /*some random addition multiplication e.g.*/
> d=120302.0;
> d+=1000; d/=3.4565;
>}

>Compiled with maximum optimisation this runs on an Ultra 30
>in 5 seconds.

If it had optimized it away, it would take almost exactly 0 seconds.
So I guess it's doing *something*. I think it's true to say that most
C compilers are far more cautious about optimising floating point
code than integer code.

--
Edwin Young



Sun, 15 Jul 2001 03:00:00 GMT  
 Need code to compare speed of two computers.

Quote:

> Does anyone have a suitable algorithim to tax a computer.
> I need to compare the execution times on two machines.

  Such a test is not very meaningful, because it is too heavily dependant on
the compiler and on the sort of application; you should do a benchmark, i.e.
compare execution times of the same application compiled on the two machines.
The application should be of the type you are interested to run (graphics,
compiling, mathematics), and generated from the same sources (a common case on
UNIX machines) with the same compiler (find a portable compiler, such as GNU
GCC).

--
 .      -   #####         +      . ****  luca78  ****       +       .
     +      #--O_O     .              +            -    *      .      -

    *  ###  |####     -     .     +      *        -     .       +     *



Mon, 06 Aug 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Comparing two codes.

2. comparing two codes.

3. Help--need really fast search to compare two HUGE files of text records

4. Need help comparing two arrays

5. Need to compare two binary files

6. Need sample code to compare binary files

7. Compared execution speeds

8. Comparing Computer Languages

9. The speed of my computer....

10. How to compare two huge file programically?

11. comparing two float[] s

12. Comparing two directories

 

 
Powered by phpBB® Forum Software