4

From the research I have done so far I learned that there the MIPS is highly dependent upon the application being run, or the language.

But can anyone give me their best guess for a 2.5 Ghz computer in MIPS? Or any other number of Ghz?

C++ if that helps.

markgz
  • 6,054
  • 1
  • 19
  • 41
Amadeus Bojiuc
  • 179
  • 1
  • 2
  • 11
  • 3
    Chip technology improvements keep changing this ratio. It's really impossible to make generalizations. – Mark Ransom Apr 22 '13 at 19:02
  • Do I need to contact Intel? – Amadeus Bojiuc Apr 22 '13 at 19:04
  • 2
    I do 1800 pencil strokes per hour. Can you guess how many objects I can draw in an hour? –  Apr 22 '13 at 19:06
  • So there is no way to determine it? – Amadeus Bojiuc Apr 22 '13 at 19:09
  • 1
    Yes, there's a way - benchmark it using a program with a known number of instructions of the type you're interested in measuring, on the chip you want to know the MIPS rating of. From there the relationship between MIPS and clock speed should be mostly linear. – Mark Ransom Apr 22 '13 at 19:11
  • Ok I think I understand now, the term calculation can be as small as 1+1, or as big as 1+2+3+4+5+6+7, making it hard to make broad estimates. So first I need to define the size of my calculations? – Amadeus Bojiuc Apr 22 '13 at 19:13

3 Answers3

6

MIPS stands for "Million Instructions Per Second", but that value becomes difficult to calculate for modern computers. Many processor architectures (such as x86 and x86_64, which make up most desktop and laptop computers) fall into the CISC category of processors. CISC architectures often contain instructions that perform several different tasks at once. One of the consequences of this is that some instructions take more clock cycles than other instructions. So even if you know your clock frequency (in this case 2.5 gigahertz), the number of instructions run per second depends mostly on which instructions a program uses. For this reason, MIPS has largely fallen out of use as a performance metric.

Matt Kline
  • 10,149
  • 7
  • 50
  • 87
  • It's not so much because of CISC, it's that things like a load instruction can stall for hundreds of cycles on a cache miss, or not at all on a cache hit. With out-of-order exec, the CPU's ability to hide that stall (by running independent other instructions) depends on surrounding code. Also branch instructions are cheap if predicted correctly, otherwise lead to a stall. And on superscalar machines, data dependencies between instructions determine how much instruction-level parallelism there is to be found. MIPS depends not just on which insns you pick, but on their operands and data! – Peter Cordes Sep 25 '21 at 10:37
  • Even on a RISC machine, different workloads can have very different IPC (and thus MIPS). So yes, MIPS has fallen out of use as a performance metric (because it's nowhere near constant across different workloads on the same machine), but this CISC explanation isn't why. It's not even accurate to say an instruction "takes" a certain number of clock cycles; on superscalar OoO exec machines, [you can't find performance by adding up fixed cycle costs across different instructions.](https://stackoverflow.com/questions/692718/how-many-cpu-cycles-are-needed-for-each-instruction/44980899#44980899) – Peter Cordes Sep 25 '21 at 10:40
4

For some of my many benchmarks, identified in

http://www.roylongbottom.org.uk/

I produce an assembly code listing from which actual assembler instructions used can be calculated (Note that these are not actual micro instructions used by the RISC processors). The following includes %MIPS/MHz calculations based on these and other MIPS assumptions.

http://www.roylongbottom.org.uk/cpuspeed.htm

The results only apply for Intel CPUs. You will see that MIPS results depend on whether CPU, cache or RAM data is being used. For a modern CPU at 2500 MHz, likely MIPS are between 1250 and 9000 using CPU/L1 cache but much less accessing data in RAM. Then there are SSE SIMD integer instructions. Real integer MIPS for simple register based additions are in:

http://www.roylongbottom.org.uk/whatcpu%20results.htm#anchorC2D

Where my 2.4 GHz Core 2 CPU is shown to run at up to 17531 MIPS.

Roy

Roy Longbottom
  • 1,192
  • 1
  • 6
  • 8
2

MIPS officially stands for Million Instructions Per Second but the Hacker's Dictionary defines it as Meaningless Indication of Processor Speed. This is because many companies use the theoretical maximum for marketing which is never achieved in real applications. E.g. current Intel processors can execute up to 4 instructions per cycle. Following this logic at 2.5 GHz it achieves 10,000 MIPS. In real applications, of course, this number is never achieved. Another problem, which slavik already mentions, is that instructions do different amounts of useful work. There are even NOPs, which–by definition–do nothing useful yet contribute to the MIPS rating.

To correct this people began using Dhrystone MIPS in the 1980s. Dhrystone is a synthetical benchmark (i.e. it is not based on a useful program) and one Dhrystone MIPS is defined relative to the benchmark performance of a VAX 11/780. This is only slightly less ridiculous than the definition above.

Today, performance is commonly measured by SPEC CPU benchmarks, which are based on real world programs. If you know these benchmarks and your own applications very well, you can make resonable predictions of performance without actually running your application on the CPU in question.

They key is to understand that performance will vary widely based on a number of characteristics. E.g. there used to be a program called The Many Faces of Go which essentially hard codes knowledge about the Board Game in many conditional if-clauses. The performance of this program is almost entirely determined by the branch predictor. Other programs use hughe amounts of memory that does not fit into any cache. The performance of these programs is determined by the bandwidth and/or latency of the main memory. Some applications may depend heavily on the throughput of floating point instructions while other applications never use any floating point instructions. You get the idea. An accurate prediction is impossible without knowing the application.

Having said all that, an average number would be around 2 instructions per cycle and 5,000 MIPS @ 2.5 GHz. However, real numbers can be easily ten or even a hundred times lower.

Mackie Messer
  • 7,118
  • 3
  • 35
  • 40
  • Since you mentions SPEC, https://www.researchgate.net/publication/322745869_A_Workload_Characterization_of_the_SPEC_CPU2017_Benchmark_Suite measured IPC on SPECint2017 and SPECfp2017, finding an average across benchmarks of about 1.7 IPC on Haswell. (I think they say that's for SPECrate_fp, i.e. keeping the CPU busy by running multiple copies of the benchmark in parallel, otherwise IPC is lower, like 1.2 or 0.7, presumably because of dependency-chain bottlenecks on FP instruction latency, and/or mem bandwidth in arrays) – Peter Cordes Sep 25 '21 at 10:43