MCPS & MIPS
MIPS:Million Instructions Per Second
MCPS:Million Cycles Per Second
MIPS = Total Instructions*Sampling frequency/(No of frames * Samples per frame*1000000)
MCPS = Total Cycles*Sampling frequency/(No of frames * Samples per frame*1000000)
MHz is same as MCPS
And as we know , some instructions may take more than 1 cycle ,so sometimesMIPS >= MCPS.
But as the Parallel Processing techniquedeveloping,one cyclecan excute more than oneinstruction, so sometime MCPS>=MIPS
Also some time the frame length is not uniform, so the they will be
MIPS = Total Instructions/(Total playout time *1000000)
MHz=MCPS = Total Cycles/(Total playout time*1000000)
For example:
struct timespec start, end;
unsinged long diff_ns;
clock_gettime(CLOCK_THREAD_CPUTIME_ID, &start);
process()// process fixed in CPU core, process N samples;
clock_gettime(CLOCK_THREAD_CPUTIME_ID, &end);
diff_ns = (end.tv_sec - start.tv_sec) * 1000000000 + (end.tv_nsec - start.tv_nsec) ;
cpu_freq: 1GHz. 1秒鐘經過的時鐘周期
Cycles是處理N個samples所需要的時鐘周期
Cyles:diff_ns * cpu_freq = (diff_ns / 1000000000) * 1 GHz =(diff_ns / 1000000000) * 1000000000Hz;
處理N個samples所需要的時間為:N samples / sampling frequency
MCPS = (Cycles / (N Samples / Sample Frequency)) / 1000000;
總結
以上是生活随笔為你收集整理的MCPS & MIPS的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: JMeter 调试取样器(Debug S
- 下一篇: 多线程方式采集搜狗高清壁纸的实现