Re: Test cpu speed



"Luca >0.0<" <luca@xxxxxxxxxxxxxx> writes:

You will NEVER be able to answer the question "which core is absolute
best". You can only answer the question "which is core is best for a
certain application". If you know what sort of processing you will be
doing, test that. Even there, if you produce an inefficient
implementation, CPU #1 might perform better than #2, even though a
better program might perform better on #2.

Yes I know and you're right.
I want only a 'mean' eval, just to have some maxima indications of general
performance..
I've tried to write something like this:

-operation1 (count from 1 to 10e7)
-eval time1
-operation2 (multiply two random (100x100) matrices)
-eval time2
-operation3 (resolve VdPole Ode with 5000 points)
-eval time3
-total_time=time1+time2+time3
-total_average_time=(total_time) /3

Is it so ridicolous for a very approximate test?

I would not call it ridiculous. But I would also say that it will not
measure much that is useful.

Certainly if you run this benchmark on two CPUs with exactly the same
archictecture, just different clock speeds, then the faster clocked
CPU will run these faster. But you don't need a benchmark for that
anyway.

Can you extrapolate the 100x100 multiply to a 1000x1000 multiply, or
larger? No. The memory bandwidth will start to dominate, and you're
not measuring that.

Can you extrapolate the counting test to other, more complex, loops?
Not really. The MATLAB optimizer makes this stuff very complex. A
larger loop results in more instructions to be loaded from memory,
possibly exceeding the instruction cache. As the loop contents
change, you might shift from a fully optimized MATLAB loop to one that
includes function calls.

What you are describing is a research topic all on its own. It is
possible to build good benchmarks for certain classes of operations,
but to be good, you need to validate the benchmark against the
performance of an actual program.

Unless you are interested in researching and studying computer
architectures, stick with "bench" or some synthetic benchmark
published on the web, or run a piece of code which is very similar to
the program you know you want to run. Understand I'm not trying to
discourage you from trying this stuff. You asked for comments, so
I'll give you comments ;)

-Peter
.



Relevant Pages

  • Re: Why is C# 450% slower than C++ on nested loops ??
    ... The posted benchmark was crucial to ... > compilers generate for the loop and get over with it. ... > additions in the outer loops, which the C# compiler doesn't. ... gotten around to implementing every possible optimization in every language, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Bit-order reversal (little-endian <--> big-endian)
    ... The only thing I did with your do loop is ... copy and paste it into a benchmark app. ... Certainly you can use a standard if then statement instead of the IIF. ... design is faster as it avoids extra iterations. ...
    (microsoft.public.vb.general.discussion)
  • Re: circular shifting a vector/matrix - Problem
    ... Unfortunately circshift is a handy function, ... knocked up this fast and dirty benchmark to give you an idea of how to do ... in a very straigthforward way and still in a loop if that's ... I am using "corr2" as a way to compute the similarity between these ...
    (comp.soft-sys.matlab)
  • Re: string comparison
    ... > hoops to "make it work". ... No need to jump through hoops: ... My gut feeling is that the loop with eq will ... I'll try benchmark later. ...
    (comp.lang.perl.misc)
  • Re: Cost of calling a standard library function
    ... It accesses/reads memory using esi 4 ... > safly move it within the cache, without having to go via ebx. ... try it the same thing on a different earlier CPU, ... should check it out...for "tight inner loop" stuff, ...
    (alt.lang.asm)