|
昨天欣喜收到官方赠送的cubieboard2测试版,随即进行了一些最简单的CPU性能评测——仅供参考,不具备太大的实际意义——因为测试程序仅仅运行简单的整数、浮点运算,没有采用内部的优化方式和特殊指令。
测试程序
整数性能测试程序如下:
- #include <stdio.h>
- int main()
- {
- int i,j;
- int result;
- for(i=1;i<100000;i++){
- for(j=1;j<10000;j++){
- result=(i+j)%i+i+j;
- }
- }
- printf("%d\n",result);
- }
复制代码 浮点数性能测试程序如下:
- #include <stdio.h>
- int main()
- {
- float f1,f2,f3;
- f1=1.023;
- f2=9.987;
- f3=5.4321;
- int m,n;
- float result=1.0;
- for(m=1;m<100000;m++){
- for(n=1;n<10000;n++)
- {
- result=(result*f1*f2)/f3;
- if(result>10000.0)result=result/100.0;
- }
- }
- printf("%f\n",result);
- }
复制代码 测试平台
* Intel Xeon (i7 Xeon)
- ...
- model name : Intel(R) Xeon(R) CPU E5606 @ 2.13GHz
- stepping : 2
- microcode : 0x14
- cpu MHz : 2128.000
- cache size : 8192 KB
- ...
复制代码 * Intel Core2 (Lenovo T61 , 2.0GHz)
- ...
- model name : Intel(R) Core(TM)2 Duo CPU T7300 @ 2.00GHz
- stepping : 10
- microcode : 0x92
- cpu MHz : 2001.000
- cache size : 4096 KB
复制代码 * ARM Cortex-A8 (Cubieboard 1.2GHz)
- Processor : ARMv7 Processor rev 2 (v7l)
- BogoMIPS : 1192.71
- Features : swp half thumb fastmult vfp edsp neon vfpv3 tls
- CPU implementer : 0x41
- CPU architecture: 7
- CPU variant : 0x3
- CPU part : 0xc08
- CPU revision : 2
- Hardware : sun4i
- Revision : 0000
- Serial : 0000000000000000
复制代码 * ARM Cortex-A9 (Pandaboard ES 1.2GHz )
- Processor : ARMv7 Processor rev 10 (v7l)
- processor : 0
- BogoMIPS : 2387.98
- processor : 1
- BogoMIPS : 2399.58
- Features : swp half thumb fastmult vfp edsp thumbee neon vfpv3 tls
- CPU implementer : 0x41
- CPU architecture: 7
- CPU variant : 0x2
- CPU part : 0xc09
- CPU revision : 10
- Hardware : OMAP4 Panda board
- Revision : 0020
- Serial : 0000000000000000
复制代码 * ARM Cortex-A7 (Cubieboard2 Allwinner A20, 1.2GHz)
- root@CubieA20:/home/linaro/coding/c# cat /proc/cpuinfo
- Processor : ARMv7 Processor rev 4 (v7l)
- processor : 0
- BogoMIPS : 2382.14
- processor : 1
- BogoMIPS : 2399.39
- Features : swp half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpv4 idiva idivt
- CPU implementer : 0x41
- CPU architecture: 7
- CPU variant : 0x0
- CPU part : 0xc07
- CPU revision : 4
- Hardware : sun7i
- Revision : 0000
- Serial : 00000000000000000000000000000000
复制代码 测试结果
* Intel Xeon (i7 Xeon)
- user@dmlab:~$ time ./int
- 119997
- real 0m5.509s
- user 0m5.472s
- sys 0m0.000s
- ...
- user@dmlab:~$ time ./float
- 3648.838867
- real 0m16.046s
- user 0m16.005s
- sys 0m0.000s
复制代码 * Intel Core2 (Lenovo T61 Laptop)
- user@T61:~/coding/c$ time ./int
- 119997
- real 0m6.090s
- user 0m6.084s
- sys 0m0.004s
- user@T61:~/coding/c$ time ./float
- 3648.838867
- real 0m17.943s
- user 0m17.925s
- sys 0m0.004s
复制代码 * ARM Cortex-A8 (Cubieboard)
- cubie@cubieboard:~/coding$ time ./int
- 119997
- real 0m44.256s
- user 0m44.020s
- sys 0m0.020s
- cubie@CUBIEBOX:~$ time ./float
- 3648.838867
- real 2m22.439s
- user 2m21.410s
- sys 0m0.130s
复制代码 * Cortex-A9 (Pandaboard ES)
- panda@panda-desktop:~$ time ./int
- 119997
- real 0m38.952s
- user 0m38.922s
- sys 0m0.000s
- panda@panda-desktop:~$ time ./float
- 3648.838867
- real 0m42.904s
- user 0m42.852s
- sys 0m0.008s
复制代码 * ARM Cortex-A7 (Cubieboard2 Allwinner A20, 1.2GHz)
- root@CubieA20:/home/linaro/coding/c# time ./int
- 119997
- real 0m55.785s
- user 0m55.720s
- sys 0m0.010s
- root@CubieA20:/home/linaro/coding/c# time ./float
- 3648.838867
- real 0m39.499s
- user 0m39.490s
- sys 0m0.000s
复制代码 结论
* ARM vs. X86
Cortex-A8的单核效率比起X86还是落后较多的;本测试没办法找到同频率的CPU来测试,X86 CPU大约2GHz主频,A8才1.2GHz(由1.0GHz超频得到), Pandaboard是默认的1.2GHz,cubieboard2也是超频到1.2Ghz; 测试程序的速度差了数倍之多;目测即使把A8的频率升到2GHz,速度也估计也要差个3~4倍;A7、A9的整数性能与X86差距也比较大,但浮点性能已经逼近X86了。
* Cortex-A8 vs. A9
A8和A9都在同一频率(1.2GHz)下的性能还是有差距的,虽然整数性能接近,但浮点性能上A9惊人地超过A8三倍多,直逼X86的性能,非常强悍。
* Cortex-A7
得益于新架构,A7的浮点性能比A8大幅上升,甚至超越了A9,加上出色的功耗控制,A7有极高的效能比; 但整数性能还很相对较弱。
|
|