CubieBoard中文论坛

 找回密码
 立即注册
搜索
热搜: unable
查看: 10884|回复: 1

cubieboard、cubieboard2、pandaboard、x86非标准评测

[复制链接]
发表于 2013-6-9 19:21:09 | 显示全部楼层 |阅读模式
昨天欣喜收到官方赠送的cubieboard2测试版,随即进行了一些最简单的CPU性能评测——仅供参考,不具备太大的实际意义——因为测试程序仅仅运行简单的整数、浮点运算,没有采用内部的优化方式和特殊指令。

测试程序

整数性能测试程序如下:

  1. #include <stdio.h>

  2. int main()
  3. {
  4.         int i,j;
  5.         int result;
  6.         for(i=1;i<100000;i++){
  7.                 for(j=1;j<10000;j++){
  8.                         result=(i+j)%i+i+j;
  9.                 }
  10.         }
  11.         printf("%d\n",result);
  12. }
复制代码
浮点数性能测试程序如下:


  1. #include <stdio.h>




  2. int main()
  3. {
  4.         float f1,f2,f3;
  5.         f1=1.023;
  6.         f2=9.987;
  7.         f3=5.4321;
  8.         int m,n;
  9.         float result=1.0;
  10.         for(m=1;m<100000;m++){
  11.                 for(n=1;n<10000;n++)
  12.                 {
  13.                         result=(result*f1*f2)/f3;
  14.                         if(result>10000.0)result=result/100.0;
  15.                 }
  16.         }




  17.         printf("%f\n",result);
  18. }

复制代码
测试平台
  * Intel Xeon (i7 Xeon)

  1. ...
  2. model name      : Intel(R) Xeon(R) CPU           E5606  @ 2.13GHz
  3. stepping        : 2
  4. microcode       : 0x14
  5. cpu MHz         : 2128.000
  6. cache size      : 8192 KB
  7. ...

复制代码
* Intel Core2 (Lenovo T61 , 2.0GHz)

  1. ...
  2. model name        : Intel(R) Core(TM)2 Duo CPU     T7300  @ 2.00GHz
  3. stepping        : 10
  4. microcode        : 0x92
  5. cpu MHz                : 2001.000
  6. cache size        : 4096 KB
复制代码
* ARM Cortex-A8 (Cubieboard 1.2GHz)

  1. Processor        : ARMv7 Processor rev 2 (v7l)
  2. BogoMIPS        : 1192.71
  3. Features        : swp half thumb fastmult vfp edsp neon vfpv3 tls 
  4. CPU implementer        : 0x41
  5. CPU architecture: 7
  6. CPU variant        : 0x3
  7. CPU part        : 0xc08
  8. CPU revision        : 2


  9. Hardware        : sun4i
  10. Revision        : 0000
  11. Serial                : 0000000000000000
复制代码
* ARM Cortex-A9 (Pandaboard ES 1.2GHz )

  1. Processor        : ARMv7 Processor rev 10 (v7l)
  2. processor        : 0
  3. BogoMIPS        : 2387.98

  4. processor        : 1
  5. BogoMIPS        : 2399.58

  6. Features        : swp half thumb fastmult vfp edsp thumbee neon vfpv3 tls 
  7. CPU implementer        : 0x41
  8. CPU architecture: 7
  9. CPU variant        : 0x2
  10. CPU part        : 0xc09
  11. CPU revision        : 10

  12. Hardware        : OMAP4 Panda board
  13. Revision        : 0020
  14. Serial                : 0000000000000000
复制代码
* ARM Cortex-A7 (Cubieboard2 Allwinner A20, 1.2GHz)

  1. root@CubieA20:/home/linaro/coding/c#  cat /proc/cpuinfo 
  2. Processor        : ARMv7 Processor rev 4 (v7l)
  3. processor        : 0
  4. BogoMIPS        : 2382.14

  5. processor        : 1
  6. BogoMIPS        : 2399.39

  7. Features        : swp half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpv4 idiva idivt 
  8. CPU implementer        : 0x41
  9. CPU architecture: 7
  10. CPU variant        : 0x0
  11. CPU part        : 0xc07
  12. CPU revision        : 4

  13. Hardware        : sun7i
  14. Revision        : 0000
  15. Serial                : 00000000000000000000000000000000
复制代码
测试结果
  * Intel Xeon (i7 Xeon)

  1. user@dmlab:~$ time ./int
  2. 119997

  3. real        0m5.509s
  4. user        0m5.472s
  5. sys        0m0.000s
  6. ...
  7. user@dmlab:~$ time ./float 
  8. 3648.838867

  9. real        0m16.046s
  10. user        0m16.005s
  11. sys        0m0.000s
复制代码
* Intel Core2 (Lenovo T61 Laptop)

  1. user@T61:~/coding/c$ time ./int
  2. 119997

  3. real        0m6.090s
  4. user        0m6.084s
  5. sys        0m0.004s

  6. user@T61:~/coding/c$ time ./float
  7. 3648.838867

  8. real        0m17.943s
  9. user        0m17.925s
  10. sys        0m0.004s

复制代码
* ARM Cortex-A8 (Cubieboard)

  1. cubie@cubieboard:~/coding$ time ./int
  2. 119997

  3. real        0m44.256s
  4. user        0m44.020s
  5. sys        0m0.020s

  6. cubie@CUBIEBOX:~$ time ./float
  7. 3648.838867

  8. real        2m22.439s
  9. user        2m21.410s
  10. sys        0m0.130s

复制代码
* Cortex-A9 (Pandaboard ES)

  1. panda@panda-desktop:~$ time ./int
  2. 119997

  3. real        0m38.952s
  4. user        0m38.922s
  5. sys        0m0.000s

  6. panda@panda-desktop:~$ time ./float 
  7. 3648.838867

  8. real        0m42.904s
  9. user        0m42.852s
  10. sys        0m0.008s
复制代码
* ARM Cortex-A7 (Cubieboard2 Allwinner A20, 1.2GHz)

  1. root@CubieA20:/home/linaro/coding/c# time ./int
  2. 119997

  3. real        0m55.785s
  4. user        0m55.720s
  5. sys        0m0.010s

  6. root@CubieA20:/home/linaro/coding/c# time ./float
  7. 3648.838867

  8. real        0m39.499s
  9. user        0m39.490s
  10. 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有极高的效能比; 但整数性能还很相对较弱。
回复

使用道具 举报

发表于 2014-1-10 16:59:11 | 显示全部楼层
a9的指令效率是2.5,a8hea7的是2.0,所以同频率下a9要快。
a7的ddr带宽小,但是测试应该不影响。
编译器的影响不能忽略。x86显然是成熟的优化过的,而arm的需要给gcc提供cpu参数才能提高效率。
另外,测试中如果发生cache换页的话,显然arm要吃亏多了。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|粤ICP备13051116号|cubie.cc---深刻的嵌入式技术讨论社区

GMT+8, 2024-4-19 13:44 , Processed in 0.022068 second(s), 15 queries .

Powered by Discuz! X3.4

© 2001-2012 Comsenz Inc. | Style by Coxxs

返回顶部