Calculate MIPS in assembly language
Calculate MIPS in assembly language
What would be the best way to calculate MIPS(Millions of instructions per second) for a CPU in x86 assembly?
d3: virtualizing kernel in progress
https://github.com/WizardOfHaas/d3/
https://github.com/WizardOfHaas/d3/
Re: Calculate MIPS in assembly language
Hi,
Cheers,
Brendan
There's only 2 ways:GAT wrote:What would be the best way to calculate MIPS(Millions of instructions per second) for a CPU in x86 assembly?
- See how many instructions you can do in a fixed amount of time
- See how long it takes to do a fixed amount of instructions
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Re: Calculate MIPS in assembly language
But wasn't there already a post about that on the Wiki?
Re: Calculate MIPS in assembly language
Hi,
There is an article about detecting the CPU speed but that doesn't help when you want instructions per second rather than cycles per second (e.g. consider a 1 GHz CPU that averages 4 instructions per cycle vs. a 4 GHz CPU that averages 1 instruction per cycle).
Cheers,
Brendan
I don't think so (I couldn't find one).Nessphoro wrote:But wasn't there already a post about that on the Wiki?
There is an article about detecting the CPU speed but that doesn't help when you want instructions per second rather than cycles per second (e.g. consider a 1 GHz CPU that averages 4 instructions per cycle vs. a 4 GHz CPU that averages 1 instruction per cycle).
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Re: Calculate MIPS in assembly language
A cautious query: What do you need the MIPS for? As Brendan pointed out, it is a very dicey metric...
If you need it to calibrate some busy-loop, the answer is simple: Measure how often the CPU executes your loop in a set amount of time. Ref. BogoMips.
If you need it to calibrate some busy-loop, the answer is simple: Measure how often the CPU executes your loop in a set amount of time. Ref. BogoMips.
Every good solution is obvious once you've found it.