soloforce 发表于 2013-6-9 19:21:09

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

昨天欣喜收到官方赠送的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有极高的效能比; 但整数性能还很相对较弱。

wwuw 发表于 2014-1-10 16:59:11

a9的指令效率是2.5,a8hea7的是2.0,所以同频率下a9要快。
a7的ddr带宽小,但是测试应该不影响。
编译器的影响不能忽略。x86显然是成熟的优化过的,而arm的需要给gcc提供cpu参数才能提高效率。
另外,测试中如果发生cache换页的话,显然arm要吃亏多了。
页: [1]
查看完整版本: cubieboard、cubieboard2、pandaboard、x86非标准评测