如何编写c++代码简单测试一下x86和arm的cpu性能(代码片段)

zhangrelay zhangrelay     2022-11-30     238

关键词:

x86:Intel(R) Core(TM) i5-8250U CPU

arm:Qualcomm ® snapdragon ™ 821(MSM8996-AC)

一千万次nop循环c代码如下:

int main() 
    int i;
    for (i = 0; i < 10000000; i++)  
    return (0);

编译和执行,如下:

gcc noploop.c -o noploop 

time ./noploop

这种方式只能大概测试,并不十分精确^_^

左x86,右arm 


x86arm
一千万次real    0m0.029s
user    0m0.028s
sys     0m0.002s
real    0m0.126s
user    0m0.093s
sys     0m0.013s
八千万次real    0m0.135s
user    0m0.135s
sys     0m0.000s
real    0m0.523s
user    0m0.487s
sys     0m0.013s


运算性能:

#include<iostream>
#include<cstdio>
#include<cmath>
#include<vector>
using namespace std;
const long long N = 1e8;
int main()
    double m_pi=M_PI;
    for(long long i=1;i<N;i++)
    
        m_pi=m_pi*i/123456;
    
    cout<<m_pi<<endl;
    return 0;

 x86:

real    0m0.654s
user    0m0.654s
sys     0m0.000s

arm:

real    0m0.948s
user    0m0.887s
sys     0m0.020s


稍微修改一下程序,再测试一下?

#include<iostream>
#include<cstdio>
#include<cmath>
#include<vector>
using namespace std;
const long long N = 8e8;
int main()
    double m_pi=M_PI;
    for(long long i=1;i<N;i++)
    
        m_pi=m_pi*i/1.23456;
    
    cout<<m_pi<<endl;
    return 0;

当然这种代码除了耗电之外,没有任何实际用途!

 


用到的指令如下:

  •   652  gcc noploop.c -o noploop
  •   653  time ./noploop
  •   654  ls
  •   655  gcc noploop8.c -o noploop8
  •   656  time ./noploop8
  •   657  grep model.name /proc/cpuinfo
  •   658  exit
  •   659  g++ calculateloop.cpp -o calculateloop
  •   660  time ./calculateloop
  •   661  ./calculateloop
  •   662  time ./calculateloop
  •   663  g++ calplusloop.cpp -o calplusloop
  •   664  time ./calplusloop

如果偏好是自己编写基准工具,在汇编中,然后对编译的机器代码进行反汇编以进行验证。怎么知道CPU实际上在做什么?

这样做通常是不切实际的,但会尽可能地分享一个案例。这是用于 CPU 基准测试的,将它与其他工具(例如 sysbench、lmbench)和主动基准测试方法一起使用。

这是使用展开的无操作 (NOP) 循环测量 CPU 时钟速度的过程。它旨在简单,最大限度地减少由缓存未命中、停顿周期和分支预测错误引起的变化。在尝试更复杂的 CPU 基准测试之前,该结果提供了一个基线。

由于在 Linux 上运行它,只能读取 /proc/cpuinfo,但并不完全信任它在虚拟化环境中(它可以伪造 cpuid)。更信任的一种方法是简单地从 CPU 性能监控单元读取周期计数器(例如,使用 perf),但在虚拟化环境中访问这些计数器的权限有限或无法访问。


补充


直接用hardinfo测试更轻松一些:

截取部分

-CPU Blowfish-
Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz        8x 1800.00 MHz  1.49
Qualcomm snapdragon 821  Unknown MHz     29.371
 

x86

Benchmarks
**********


CPU Blowfish
------------

-CPU Blowfish-
Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz        8x 1800.00 MHz  1.49
Intel(R) Pentium(R) D CPU 3.00GHz       2x 3000.00 MHz  10.84
Intel(R) Celeron(R) CPU540@ 1.86GHz     1x 1861.00 MHz  25.49
AMD Turion(tm) 64 X2 TL-58      2x 800.00 MHz   12.58
AMD Athlon(tm) 64 X2 Dual Core Processor 3800+  2x 2200.00 MHz  10.71
AMD Athlon(tm) 64 X2 Dual Core Processor 6400+  2x 1000.00 MHz  6.42
Intel(R) Core(TM)2 Extreme CPU X7900@ 2.80GHz   2x 2800.00 MHz  6.81
Intel(R) Pentium(R) M processor 1.70GHz 1x 1700.00 MHz  28.28
AMD Phenom(tm) 8650 Triple-Core Processor       3x 2300.00 MHz  5.96
Intel(R) Pentium(R) 4 CPU 2.40GHz       1x 2400.00 MHz  24.57
AMD Athlon(tm) 64 X2 Dual Core Processor 4400+  2x 1000.00 MHz  7.92
AMD Phenom(tm) II X4 940 Processor      4x 800.00 MHz   3.49
Pentium III (Coppermine)        2x 999.00 MHz   17.81
Intel(R) Pentium(R) 4 CPU 3.20GHz       2x 3200.00 MHz  12.06
Intel(R) Pentium(R) 4 CPU 1500MHz       1x 1495.00 MHz  46.56
AMD Turion(tm) 64 X2 Mobile Technology TL-58    2x 1900.00 MHz  10.10
Intel(R) Celeron(R) M processor 1.40GHz 1x 1395.00 MHz  80.94
Mobile AMD Athlon(tm) XP 2800+  1x 1459.00 MHz  18.04
Intel(R) Celeron(R) CPU420@ 1.60GHz     1x 1600.00 MHz  21.24
AMD Phenom(tm) 9750 Quad-Core Processor 4x 1200.00 MHz  4.29
Intel(R) Atom(TM) CPU N280 @ 1.66GHz    2x 1660.00 MHz  16.76
AMD Athlon(tm) X2 Dual-Core QL-60       2x 1900.00 MHz  10.59
Intel(R) Pentium(R) DualCPUT2370@ 1.73GHz       2x 1733.00 MHz  9.58
AMD Athlon(tm) XP 1900+ 1x 1593.00 MHz  31.62
AMD Athlon(tm) XP 1800+ 1x 1540.00 MHz  23.13
Intel(R) Pentium(R) M processor 1.73GHz 1x 1730.00 MHz  19.66
AMD Sempron(tm) Processor 3200+ 1x 1000.00 MHz  25.47
VIA Esther processor 1500MHz    1x 1499.00 MHz  41.59
Intel(R) Core(TM)2 Quad CPUQ6700@ 2.66GHz       4x 2669.00 MHz  3.17
AMD Athlon(tm) 64 X2 Dual Core Processor 5000+  2x 1000.00 MHz  7.49
Intel(R) Xeon(R) CPU3040@ 1.86GHz       2x 1862.00 MHz  9.11
Intel(R) Pentium(R) DualCPUT2310@ 1.46GHz       2x 1463.00 MHz  11.60
Intel(R) Core(TM)2 Duo CPU P8400@ 2.26GHz       2x 2260.00 MHz  8.29
AMD Turion(tm) X2 Dual-Core Mobile RM-74        2x 600.00 MHz   8.97
Genuine Intel(R) CPU 575@ 2.00GHz       1x 1995.00 MHz  20.36
AMD Turion(tm) 64 X2 Mobile Technology TL-62    2x 800.00 MHz   8.84
AMD Turion(tm) 64 X2 Mobile Technology TL-56    2x 800.00 MHz   10.79
Intel(R) Celeron(R) CPU 2.80GHz 1x 2793.00 MHz  40.87
Intel(R) Pentium(R) 4 CPU 2.80GHz       2x 2800.00 MHz  11.70
Genuine Intel(R) CPU2140@ 1.60GHz       2x 1595.00 MHz  10.67
AMD Athlon(tm) 7750 Dual-Core Processor 2x 1350.00 MHz  7.45
Intel(R) Core(TM)2 Duo CPU E8400@ 3.00GHz       2x 2997.00 MHz  5.54
Intel(R) Core(TM)2 CPU T7400@ 2.16GHz   2x 2161.00 MHz  9.37
Intel(R) Pentium(R) 4 CPU 2.53GHz       1x 2525.00 MHz  48.08
Intel(R) Core(TM)2 Quad CPUQ9550@ 2.83GHz       4x 2830.00 MHz  3.24
Intel(R) Core(TM)2 CPU6700@ 2.66GHz     2x 2667.00 MHz  6.90
AMD Turion(tm) X2 Dual-Core Mobile RM-72        2x 500.00 MHz   11.86
Intel(R) Core(TM)2 Duo CPU T9400@ 2.53GHz       2x 2530.00 MHz  6.76
AMD Athlon(tm) 64 X2 Dual Core Processor 4800+  2x 2512.00 MHz  8.73
Intel(R) Celeron(R) M CPU520@ 1.60GHz   1x 1600.00 MHz  22.07
Intel(R) Core(TM)2 Quad CPUQ8300@ 2.50GHz       4x 2497.00 MHz  3.35
PowerPC 740/750 1x 280.00 MHz   172.82

CPU CryptoHash
--------------

-CPU CryptoHash-
Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz        8x 1800.00 MHz  746.10
Intel(R) Atom(TM) CPU330 @ 1.60GHz      4x 1596.00 MHz  105.57
Intel(R) Core(TM)2 Duo CPU T5250@ 1.50GHz       2x 1500.00 MHz  102.95
Intel(R) Celeron(R) M processor900MHz   1x 900.00 MHz   24.34
Intel(R) Core(TM)2 CPU E8400@ 3.00GHz   2x 3000.00 MHz  163.39
Intel(R) Xeon(R) CPU E5405@ 2.00GHz     2x 1995.00 MHz  117.48
Intel(R) Core(TM) Duo CPUT2450@ 2.00GHz 2x 2000.00 MHz  127.24
Intel(R) Pentium(R) 4 CPU 2.00GHz       1x 1994.00 MHz  24.65
AMD Phenom(tm) 9350e Quad-Core Processor        4x 2000.00 MHz  237.01
AMD Turion(tm) X2 Ultra Dual-Core Mobile ZM-82  2x 600.00 MHz   100.06
AMD Athlon(tm) XP 3000+ 1x 2158.00 MHz  66.54
Intel(R) Celeron(R) M CPU520@ 1.60GHz   1x 1600.00 MHz  52.31
Intel(R) Core(TM)2 Quad CPUQ6700@ 2.66GHz       4x 2669.00 MHz  264.06
AMD Athlon(tm) XP 1900+ 1x 1593.00 MHz  31.63
Intel(R) Pentium(R) 4 CPU 3.20GHz       2x 3200.00 MHz  66.61
AMD Sempron(tm) 2600+   1x 1840.00 MHz  53.87
AMD Athlon(tm) 64 X2 Dual Core Processor 3800+  2x 2200.00 MHz  94.12
AMD Turion(tm) 64 X2 Mobile Technology TL-62    2x 800.00 MHz   119.43
AMD Athlon(tm) XP 2000+ 1x 1667.00 MHz  45.76
AMD Athlon(tm) 64 Processor 3500+       1x 1000.00 MHz  62.20
AMD Turion(tm) 64 X2 Mobile Technology TL-56    2x 800.00 MHz   92.19
AMD Athlon(tm) 64 X2 Dual Core Processor 4000+  2x 1000.00 MHz  97.04
Intel(R) Pentium(R) D CPU 3.00GHz       2x 3000.00 MHz  96.75
Mobile AMD Sempron(tm) Processor 3600+  1x 800.00 MHz   54.44
Intel(R) Core(TM)2 Quad CPUQ9650@ 3.00GHz       4x 2997.00 MHz  303.51
AMD Sempron(tm) Processor 3600+ 1x 1000.00 MHz  43.98
Intel(R) Core(TM)2 Duo CPU T9400@ 2.53GHz       2x 2530.00 MHz  148.71
AMD Turion(tm) 64 X2 Mobile Technology TL-58    2x 1900.00 MHz  101.69
Intel(R) Core(TM)2 Duo CPU P7350@ 2.00GHz       2x 2000.00 MHz  103.95
VIA Esther processor 1500MHz    1x 1499.00 MHz  7.75
Intel(R) Core(TM)2 Duo CPU P8600@ 2.40GHz       2x 2400.00 MHz  150.44
Intel(R) Core(TM)2 Duo CPU T7700@ 2.40GHz       2x 2400.00 MHz  142.54
Intel(R) Core(TM)2 Duo CPU T5550@ 1.83GHz       2x 1829.00 MHz  122.42
Intel(R) Core(TM)2 Duo CPU T7250@ 2.00GHz       2x 2001.00 MHz  121.92
Intel(R) Core(TM)2 CPU6700@ 2.66GHz     2x 2667.00 MHz  163.64
Intel(R) Pentium(R) 4 CPU 2.40GHz       1x 2400.00 MHz  30.96
Intel(R) Core(TM)2 Quad CPUQ9400@ 2.66GHz       4x 2660.00 MHz  296.87
AMD Athlon(tm) 64 Processor 3200+       1x 1000.00 MHz  42.30
Intel(R) Pentium(R) DualCPUT3200@ 2.00GHz       2x 2000.00 MHz  88.54
Intel(R) Pentium(R) 4 CPU 2.26GHz       1x 2267.00 MHz  29.41
AMD Sempron(tm) Processor 3400+ 1x 1000.00 MHz  53.84
AMD Sempron(tm) Processor 3000+ 1x 1800.00 MHz  47.79
AMD Athlon(tm) XP 2400+ 1x 1991.00 MHz  61.64
Intel(R) Atom(TM) CPU Z530 @ 1.60GHz    2x 1600.00 MHz  54.89
Pentium III (Coppermine)        1x 700.00 MHz   26.99
Intel(R) Core(TM) i7 CPU 920@ 2.67GHz   8x 3799.00 MHz  390.24
AMD Athlon(tm) 64 X2 Dual Core Processor 6000+  2x 3051.00 MHz  146.74
AMD Turion(tm) 64 Mobile Technology ML-37       1x 2000.00 MHz  42.21
Intel(R) Xeon(R) CPU3040@ 1.86GHz       2x 1862.00 MHz  127.83
AMD Athlon(tm) XP 2500+ 1x 1792.00 MHz  39.66
Intel(R) Core(TM)2 Duo CPU T9500@ 2.60GHz       2x 2593.00 MHz  172.64

CPU Fibonacci
-------------

-CPU Fibonacci-
Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz        8x 1800.00 MHz  0.37
AMD Phenom(tm) 9500 Quad-Core Processor 4x 1100.00 MHz  3.06
Intel(R) Core(TM)2 Duo CPU T7250@ 2.00GHz       2x 2001.00 MHz  4.57
Intel(R) Pentium(R) 4 CPU 2.80GHz       1x 2791.00 MHz  5.65
AMD Athlon(tm) Processor        1x 1210.00 MHz  7.34
Intel(R) Core(TM)2 CPU T5200@ 1.60GHz   2x 1067.00 MHz  7.27
Intel(R) Atom(TM) CPU330 @ 1.60GHz      4x 1596.00 MHz  8.79
AMD Phenom(tm) 9150e Quad-Core Processor        4x 900.00 MHz   3.28
AMD Turion(tm) 64 Mobile Technology MK-36       1x 800.00 MHz   6.20
AMD Athlon(tm) 64 Processor 3200+       1x 1000.00 MHz  5.76
Intel(R) Core(TM)2 Quad CPUQ9400@ 2.66GHz       4x 2003.00 MHz  2.76
Intel(R) Core(TM)2 Duo CPU T7500@ 2.20GHz       1x 2200.00 MHz  4.09
AMD Athlon(tm) XP       1x 906.00 MHz   33.45
Intel(R) Core(TM)2 Quad CPUQ6700@ 2.66GHz       4x 2669.00 MHz  3.54
Intel(R) Pentium(R) 4 CPU 2.00GHz       1x 1994.00 MHz  8.70
Intel(R) Core(TM)2 Duo CPU E6550@ 2.33GHz       2x 2700.00 MHz  3.66
Intel(R) Core(TM)2 Duo CPU T7100@ 1.80GHz       2x 1801.00 MHz  4.79
Dual Core AMD Opteron(tm) Processor 165 2x 1979.00 MHz  4.26
Intel(R) Pentium(R) 4 CPU 2.40GHz       1x 2400.00 MHz  6.35
Intel(R) Core(TM)2 Duo CPU P8600@ 2.40GHz       1x 2400.00 MHz  3.37
AMD Turion(tm) X2 Dual-Core Mobile RM-70        2x 500.00 MHz   4.97
Intel(R) Pentium(R) 4 CPU 2.53GHz       1x 2525.00 MHz  10.36
Unknown CPU Type        1x 1660.00 MHz  5.73
Pentium III (Coppermine)        2x 999.00 MHz   10.22
Intel(R) Core(TM)2 CPU T5600@ 1.83GHz   2x 1000.00 MHz  5.24
Intel(R) Celeron(R) CPU 3.06GHz 1x 3059.00 MHz  3.96
AMD Phenom(tm) 9850 Quad-Core Processor 4x 1300.00 MHz  2.59
Intel(R) Pentium(R) 4 CPU 3.00GHz       2x 3458.00 MHz  4.98
AMD Sempron(tm) Processor LE-1200       1x 2109.00 MHz  6.08
Intel(R) Pentium(R) 4 CPU 2.80GHz       1x 2791.00 MHz  5.65
AMD Athlon(tm) 64 X2 Dual Core Processor 4000+  2x 1000.00 MHz  4.12
AMD Athlon(tm) XP 1600+ 1x 1398.00 MHz  6.39
Genuine Intel(R) CPU T2050@ 1.60GHz     2x 800.00 MHz   6.10
Intel(R) Celeron(R) CPU560@ 2.13GHz     1x 2128.00 MHz  4.78
AMD Phenom(tm) 8650 Triple-Core Processor       3x 2300.00 MHz  3.09
Intel(R) Core(TM) i7 CPU 920@ 2.67GHz   8x 3799.00 MHz  2.79
AMD Athlon(tm) 64 X2 Dual Core Processor 5000+  2x 1000.00 MHz  3.11
AMD Athlon(tm) XP 2500+ 1x 1792.00 MHz  7.18
Intel(R) Xeon(R) CPU3040@ 1.86GHz       2x 1862.00 MHz  4.81
AMD Athlon(tm) X2 Dual-Core QL-60       2x 1900.00 MHz  4.35
Intel(R) Core(TM)2 CPU T7400@ 2.16GHz   2x 2161.00 MHz  4.98
AMD Turion(tm) 64 X2 Mobile Technology TL-60    2x 2000.00 MHz  4.19
AMD Turion(tm) 64 X2 Mobile Technology TL-52    2x 1600.00 MHz  5.45
AMD Athlon(tm) 64 X2 Dual Core Processor 6000+  2x 3051.00 MHz  2.75
Intel(R) Atom(TM) CPU N280 @ 1.66GHz    2x 1000.00 MHz  8.97
Intel(R) Core(TM)2 Quad CPUQ9550@ 2.83GHz       4x 2830.00 MHz  2.72
Intel(R) Core(TM)2 Duo CPU T7300@ 2.00GHz       2x 2001.00 MHz  4.77
AMD Sempron(tm) Processor 3600+ 1x 1000.00 MHz  5.70
AMD Athlon(tm)  1x 2305.00 MHz  4.47
AMD Athlon(tm) X2 Dual Core Processor BE-2300   2x 1899.00 MHz  4.37
Intel(R) Core(TM)2 Duo CPU E6750@ 2.66GHz       2x 2671.00 MHz  4.10
PowerPC 740/750 1x 280.00 MHz   58.08

CPU N-Queens
------------

-CPU N-Queens-
Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz        8x 1800.00 MHz  7.04
AMD Athlon(tm) 64 X2 Dual Core Processor 5400+  2x 1000.00 MHz  15.06
Genuine Intel(R) CPU T2080@ 1.73GHz     2x 1730.00 MHz  33.31
Intel(R) Core(TM)2 Duo CPU T5450@ 1.66GHz       2x 1660.00 MHz  14.49
Intel(R) Core(TM)2 QuadCPU Q9300@ 2.50GHz       4x 3000.00 MHz  14.10
Intel(R) Atom(TM) CPU Z530 @ 1.60GHz    2x 1600.00 MHz  18.70
Intel(R) Atom(TM) CPU330 @ 1.60GHz      4x 1596.00 MHz  26.07
AMD Athlon(tm) XP 1600+ 1x 1398.00 MHz  19.85
Intel(R) Core(TM)2 Quad CPUQ6700@ 2.66GHz       4x 2669.00 MHz  17.01
Intel(R) Pentium(R) 4 CPU 2.60GHz       2x 2600.00 MHz  14.83
Intel(R) Core(TM)2 CPU6320@ 1.86GHz     2x 1860.00 MHz  16.54
Intel(R) Core(TM)2 Extreme CPU X7900@ 2.80GHz   2x 2800.00 MHz  7.02
Intel(R) Core(TM)2 QuadCPU Q9450@ 2.66GHz       4x 2000.00 MHz  12.97
Intel(R) Core(TM)2 CPU E8400@ 3.00GHz   2x 3000.00 MHz  7.84
Pentium III (Coppermine)        2x 999.00 MHz   35.15
AMD Athlon(tm) 64 X2 Dual Core Processor 4000+  2x 1000.00 MHz  19.51
AMD Turion(tm) 64 X2 Mobile Technology TL-50    2x 800.00 MHz   23.26
Intel(R) Pentium(R) D CPU 3.40GHz       2x 3400.00 MHz  13.51
Pentium III (Coppermine)        2x 999.00 MHz   35.15
AMD Athlon(tm) 64 X2 Dual Core Processor 3600+  2x 1000.00 MHz  22.98
AMD Athlon(tm) 64 X2 Dual Core Processor 5200+  2x 2705.00 MHz  14.95
AMD Athlon(tm) 64 X2 Dual-Core Processor TK-55  2x 800.00 MHz   20.49
Intel(R) Core(TM)2 Duo CPU E6850@ 3.00GHz       2x 3000.00 MHz  7.52
Intel(R) Core(TM)2 Duo CPU P8400@ 2.26GHz       2x 2260.00 MHz  10.39
Intel(R) Core(TM)2 Quad CPUQ9400@ 2.66GHz       4x 2003.00 MHz  18.25
AMD Athlon(tm) XP 1900+ 1x 1593.00 MHz  26.74
Intel(R) Core(TM) Duo CPUT2350@ 1.86GHz 2x 1867.00 MHz  22.01
Intel(R) Core(TM)2 Duo CPU E8400@ 3.00GHz       2x 2997.00 MHz  7.66
AMD Athlon(tm) XP 2800+ 1x 2087.00 MHz  13.55
Genuine Intel(R) CPU T2500@ 2.00GHz     2x 2000.00 MHz  28.39
AMD Turion(tm) 64 X2 Mobile Technology TL-58    2x 1900.00 MHz  20.02
Intel(R) Pentium(R) 4 CPU 3.40GHz       2x 3400.00 MHz  15.30
Intel(R) Celeron(R) M processor900MHz   1x 900.00 MHz   33.26
AMD Athlon(tm) X2 Dual-Core QL-60       2x 1900.00 MHz  20.34
Intel(R) Core(TM)2 Duo CPU T5850@ 2.16GHz       2x 2167.00 MHz  10.37
Mobile AMD Athlon(tm) XP-M Processor 3000+      1x 799.00 MHz   52.78
AMD Phenom(tm) 9500 Quad-Core Processor 4x 1100.00 MHz  10.06
Intel(R) Celeron(R) M processor 1.40GHz 1x 1395.00 MHz  94.05
Mobile AMD Athlon(tm) XP 2800+  1x 1459.00 MHz  13.36
AMD Athlon(tm) 64 Processor 3000+       1x 1800.00 MHz  18.08
Genuine Intel(R) CPU L2400@ 1.66GHz     2x 1660.00 MHz  19.55
AMD Sempron(tm) Processor 2800+ 1x 1999.00 MHz  17.23
AMD Sempron(tm) 2600+   1x 1840.00 MHz  14.69
Intel(R) Pentium(R) M processor 1600MHz 1x 1600.00 MHz  15.23
Genuine Intel(R) CPU 575@ 2.00GHz       1x 1995.00 MHz  15.88
Genuine Intel(R) CPU T2300@ 1.66GHz     2x 1660.00 MHz  27.25
Intel(R) Pentium(R) M processor 1.70GHz 1x 1700.00 MHz  22.55
AMD Athlon(tm) XP processor 1800+       1x 1533.00 MHz  17.55
Intel(R) Core(TM)2 Duo CPU T5750@ 2.00GHz       2x 1994.00 MHz  11.14
Intel(R) Core(TM)2 Duo CPU T7250@ 2.00GHz       2x 2001.00 MHz  11.39
Intel(R) Pentium(R) 4 CPU 1500MHz       1x 1495.00 MHz  28.46

CPU Zlib
--------

-CPU Zlib-
Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz        8x 1800.00 MHz  0.97
PowerPC 740/750 1x 280.00 MHz   2150.60

FPU FFT
-------

-FPU FFT-
Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz        8x 1800.00 MHz  1.13
Intel(R) Pentium(R) DualCPUT3200@ 2.00GHz       2x 2000.00 MHz  5.50
Intel(R) Celeron(R) CPU 2.53GHz 1x 2527.00 MHz  10.12
Genuine Intel(R) CPU T1350@ 1.86GHz     1x 1867.00 MHz  83.47
AMD Turion(tm) 64 X2 Mobile Technology TL-60    2x 2000.00 MHz  8.22
AMD Turion(tm) X2 Dual-Core Mobile RM-70        2x 500.00 MHz   8.31
Intel(R) Core(TM) Duo CPUT2350@ 1.86GHz 2x 1867.00 MHz  5.36
Intel(R) Core(TM)2 Duo CPU T5750@ 2.00GHz       2x 1994.00 MHz  4.23
Intel(R) Core(TM)2 Duo CPU T9500@ 2.60GHz       2x 2593.00 MHz  3.12
AMD Athlon(tm) X2 Dual-Core QL-60       2x 1900.00 MHz  9.08
Intel(R) Core(TM)2 Duo CPU T5250@ 1.50GHz       2x 1500.00 MHz  5.51
Mobile AMD Athlon(tm) XP-M Processor 3000+      1x 799.00 MHz   43.15
AMD Athlon(tm) 64 X2 Dual Core Processor 4000+  2x 1000.00 MHz  8.00
AMD Athlon(tm) XP processor 1800+       1x 1533.00 MHz  25.14
Genuine Intel(R) CPU2140@ 1.60GHz       2x 1595.00 MHz  5.44
Intel(R) Core(TM)2 Quad CPUQ6600@ 2.40GHz       4x 2400.00 MHz  1.63
Intel(R) Core(TM)2 Duo CPU P7350@ 2.00GHz       2x 2000.00 MHz  4.76
Genuine Intel(R) CPU T2080@ 1.73GHz     2x 1730.00 MHz  4.99
Intel(R) Celeron(R) CPU 2.50GHz 1x 2492.00 MHz  14.46
Intel(R) Pentium(R) M processor 1.86GHz 1x 1867.00 MHz  11.88
Intel(R) Core(TM)2 CPU T5200@ 1.60GHz   2x 1600.00 MHz  6.49
Intel(R) Core(TM)2 CPU6320@ 1.86GHz     2x 1860.00 MHz  4.91
AMD Athlon(tm) XP       1x 906.00 MHz   84.35
AMD Athlon(tm) 64 Processor 3000+       1x 1800.00 MHz  25.19
Intel(R) Pentium(R) 4 CPU 2.60GHz       2x 2600.00 MHz  8.54
Intel(R) Core(TM)2 Quad CPUQ9400@ 2.66GHz       4x 2660.00 MHz  1.49
Intel(R) Pentium(R) M processor 1600MHz 1x 1600.00 MHz  13.50
Pentium(R) Dual-Core CPU T4200@ 2.00GHz 2x 2000.00 MHz  4.62
Intel(R) Core(TM)2 Quad CPU @ 2.40GHz   4x 2400.00 MHz  1.70
Intel(R) Core(TM)2 Quad CPUQ8300@ 2.50GHz       4x 2497.00 MHz  1.66
Intel(R) Core(TM)2 Extreme CPU X7900@ 2.80GHz   2x 2800.00 MHz  3.06
Intel(R) Celeron(R) D CPU 3.20GHz       1x 3196.00 MHz  8.55
AMD Sempron(tm) 2600+   1x 1840.00 MHz  20.95
AMD Athlon(tm) 64 X2 Dual Core Processor 4400+  2x 1000.00 MHz  6.80
Intel(R) Celeron(R) CPU 2.66GHz 1x 2666.00 MHz  9.89
Intel(R) Core(TM) Duo CPUT2450@ 2.00GHz 2x 2000.00 MHz  4.33
Intel(R) Celeron(R) M CPU520@ 1.60GHz   1x 1600.00 MHz  11.35
Intel(R) Pentium(R) 4 CPU 3.06GHz       2x 3065.00 MHz  7.45
Intel(R) Core(TM)2 CPU4300@ 1.80GHz     2x 1800.00 MHz  5.37
Intel(R) Core(TM)2 CPU6400@ 2.13GHz     2x 2128.00 MHz  4.68
AMD Turion(tm) 64 Mobile Technology MK-36       1x 800.00 MHz   19.96
Intel(R) Core(TM)2 CPU6600@ 2.40GHz     2x 2400.00 MHz  3.55
Intel(R) Core(TM)2 Duo CPU T7250@ 2.00GHz       2x 2001.00 MHz  4.16
Intel(R) Celeron(R) M processor900MHz   1x 900.00 MHz   24.21
AMD Sempron(tm) Processor 3400+ 1x 1000.00 MHz  17.11
AMD Athlon(tm) XP 2500+ 1x 1792.00 MHz  27.33
AMD Sempron(tm) Processor 3000+ 1x 1800.00 MHz  18.94
AMD Athlon(tm) XP 2200+ 1x 1782.00 MHz  22.20
Intel(R) Pentium(R) 4 CPU 3.06GHz       2x 3065.00 MHz  7.45
AMD Processor model unknown     2x 3006.00 MHz  5.24
AMD Turion(tm) 64 X2 Mobile Technology TL-62    2x 800.00 MHz   7.52

FPU Raytracing
--------------

-FPU Raytracing-
Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz        8x 1800.00 MHz  2.05
Intel(R) Core(TM) Duo CPUT2450@ 2.00GHz 2x 2000.00 MHz  28.36
AMD Athlon(tm) XP 2200+ 1x 1782.00 MHz  29.74
Intel(R) Pentium(R) DualCPUT2370@ 1.73GHz       2x 1733.00 MHz  25.82
AMD Sempron(tm) Processor 3200+ 1x 1000.00 MHz  30.19
AMD Athlon(tm) 64 X2 Dual-Core Processor TK-55  2x 800.00 MHz   16.47
Intel(R) Core(TM)2 CPU6600@ 2.40GHz     2x 2400.00 MHz  11.24
Intel(R) Core(TM)2 Duo CPU T5270@ 1.40GHz       2x 1400.00 MHz  32.81
AMD Athlon(tm) 64 X2 Dual-Core Processor TK-53  2x 800.00 MHz   18.47
Intel(R) Pentium(R) M processor 1.86GHz 1x 1867.00 MHz  28.20
Intel(R) Core(TM)2 Duo CPU T5750@ 2.00GHz       2x 1994.00 MHz  16.38
AMD Turion(tm) 64 Mobile Technology ML-32       1x 800.00 MHz   28.43
Intel(R) Celeron(R) CPU530@ 1.73GHz     1x 2593.00 MHz  17.55
Intel(R) Core(TM) i7 CPU 920@ 2.67GHz   8x 3799.00 MHz  4.73
Intel(R) Core(TM)2 Quad CPUQ9650@ 3.00GHz       4x 2997.00 MHz  18.84
AMD Turion(tm) 64 Mobile Technology MK-36       1x 800.00 MHz   30.84
Intel(R) Pentium(R) D CPU 3.40GHz       2x 3400.00 MHz  25.42
AMD Athlon(tm) X2 Dual-Core QL-60       2x 1900.00 MHz  18.30
Intel(R) Pentium(R) III CPU - S 1400MHz 1x 1392.00 MHz  33.36
AMD Phenom(tm) II X4 20 Processor       4x 3654.00 MHz  13.29
Intel(R) Core(TM)2 CPU E8400@ 3.00GHz   2x 3000.00 MHz  15.79
Intel(R) Pentium(R) 4 CPU 2.66GHz       1x 2676.00 MHz  32.38
Intel(R) Pentium(R) 4 CPU 2.60GHz       2x 2600.00 MHz  57.37
Intel(R) Core(TM)2 Duo CPU P9500@ 2.53GHz       2x 2535.00 MHz  5.51
Intel(R) Celeron(R) M processor900MHz   1x 900.00 MHz   64.67
AMD Athlon(tm) 64 X2 Dual Core Processor 4800+  2x 2512.00 MHz  12.80
Intel(R) Pentium(R) M processor 1.73GHz 1x 1730.00 MHz  27.69
Genuine Intel(R) CPU T2080@ 1.73GHz     2x 1730.00 MHz  31.11
AMD Athlon(tm) 64 Processor 4000+       1x 1000.00 MHz  20.49
Intel(R) Pentium(R) 4 CPU 2.53GHz       1x 2525.00 MHz  36.54
Intel(R) Celeron(R) CPU560@ 2.13GHz     1x 2128.00 MHz  21.15
Intel(R) Core(TM)2 Extreme CPU X7900@ 2.80GHz   2x 2800.00 MHz  18.27
Intel(R) Core(TM)2 Duo CPU T9400@ 2.53GHz       2x 2530.00 MHz  5.59
AMD Athlon(tm) 64 X2 Dual Core Processor 6400+  2x 1000.00 MHz  10.93
Intel(R) Celeron(R) M CPU420@ 1.60GHz   1x 1599.00 MHz  37.00
Intel(R) Xeon(R) CPU E5405@ 2.00GHz     2x 1995.00 MHz  17.81
Genuine Intel(R) CPU2140@ 1.60GHz       2x 1595.00 MHz  22.05
Intel(R) Pentium(R) M processor 1700MHz 1x 1700.00 MHz  27.28
Pentium II (Deschutes)  1x 401.00 MHz   124.07
Intel(R) Core(TM)2 Duo CPU T8100@ 2.10GHz       2x 2094.00 MHz  23.76
Intel(R) Core(TM)2 CPU4300@ 1.80GHz     2x 1800.00 MHz  18.17
AMD Athlon(tm) XP 3000+ 1x 2158.00 MHz  23.07
AMD Phenom(tm) 8450 Triple-Core Processor       3x 1100.00 MHz  18.56
Intel(R) Core(TM)2 Duo CPU P8400@ 2.26GHz       2x 2260.00 MHz  12.07
AMD Athlon(tm) XP 1800+ 1x 1540.00 MHz  31.73
Intel(R) Celeron(R) CPU550@ 2.00GHz     1x 1995.00 MHz  23.90
Intel(R) Pentium(R) 4 CPU 3.20GHz       2x 3200.00 MHz  31.44
Intel(R) Pentium(R) M processor 1.80GHz 1x 1800.00 MHz  27.13
Intel(R) Celeron(R) CPU 2.80GHz 1x 2793.00 MHz  81.05
Genuine Intel(R) CPU T1350@ 1.86GHz     1x 1867.00 MHz  222.18
Intel(R) Pentium(R) 4 CPU 2.80GHz       1x 2791.00 MHz  28.66
PowerPC 740/750 1x 280.00 MHz   161.31

ARM:

Benchmarks
**********


CPU Blowfish
------------

-CPU Blowfish-
Qualcomm snapdragon 821  Unknown MHz     29.371
Intel(R) Celeron(R) M processor         1.50GHz (null)  26.1876862
PowerPC 740/750 (280.00MHz)     (null)  172.816713

CPU CryptoHash
--------------

-CPU CryptoHash-
Qualcomm snapdragon 821  Unknown MHz     79.139

CPU Fibonacci
-------------

-CPU Fibonacci-
Qualcomm snapdragon 821  Unknown MHz     4.549
Intel(R) Celeron(R) M processor         1.50GHz (null)  8.1375674
PowerPC 740/750 (280.00MHz)     (null)  58.07682

CPU N-Queens
------------

-CPU N-Queens-
Qualcomm snapdragon 821  Unknown MHz     11.847

FPU FFT
-------

-FPU FFT-
Qualcomm snapdragon 821  Unknown MHz     16.675

FPU Raytracing
--------------

-FPU Raytracing-
Qualcomm snapdragon 821  Unknown MHz     7.215
Intel(R) Celeron(R) M processor         1.50GHz (null)  40.8816714
PowerPC 740/750 (280.00MHz)     (null)  161.312647


在x86的docker中构建tvm的arm环境(代码片段)

...这件事5.3验证安装是否成功结束语前言  本篇文章介绍如何在x86的docker中构建tvm的ARM环境,以及如何使用RPC使编译在x86的环境中运行在arm的环境中,还介绍了如何在arm环境中进行编译和运行,并提供详细的示例以供... 查看详情

如何从 gcc 内联 arm7 程序集中调用 c++ 成员函数

】如何从gcc内联arm7程序集中调用c++成员函数【英文标题】:Howtocallac++memberfunctionfromgccinlinearm7assembly【发布时间】:2012-08-0422:04:20【问题描述】:我有以下在x86上工作的代码,我需要将其转换为gcc/arm7内联汇编。似乎替换堆栈只... 查看详情

如何实现对arm汇编指令的调试?

学习ARM汇编语言时,少不了对ARM汇编指令的调试。作为支持多语言的调试器,gdb自然是较好的选择。调试器工作时,一般通过修改代码段的内容构造trap软中断指令,实现程序的暂停和程序执行状态的监控。为了在x86平台上执行A... 查看详情

ros新手测试简单的service和client

ROS新手测试简单的Service和Client编写简单的Service和Client(C++)Description:本教程介绍如何用C++编写Service和Client节点。TutorialLevel:BEGINNERNextTutorial:测试简单的Service和Client编写Service节点这里,我们将创建一个简单的service节点(“add_two_ints_... 查看详情

在x86的docker中构建tvm的arm环境(代码片段)

文章目录前言1.加载arm-ubuntu镜像2.安装acl库3.编译arm运行时4.编译在x86运行在arm4.1在x86的环境中构建arm的编译环境4.2测试x86-ubuntu与arm-ubuntu能否ping通4.3调用RPC4.4ACL的使用5.arm版的tvm编译和运行时环境5.1构建arm版的tvm编译和运行时环... 查看详情

编写一个跨步的x86基准测试(代码片段)

我想编写一个加载基准测试,它使用编译时已知的步幅跨越给定的内存区域,在尽可能少的非加载指令的情况下包裹在区域的末尾(2的幂)。例如,给定一个4099的步幅,以及rdi中的迭代计数和rsi中指向内存区域的指针,“工作... 查看详情

c++套接字和压力测试(代码片段)

...加了Sleep(5)(毫秒),一切正常。目前。我的问题是:如何正确处理这些重新连接?什么是压力测试套接字服务器应用程序的正确方法?现在程序如下:客户端:使用connect 查看详情

用c++编写一个简单的发布者和订阅者(代码片段)

...过ROS图进行通信的可执行进程。本文分享自华为云社区《编写一个简单的发布者和订阅者》,作者:MAVER1CK。@[toc]参考官方文档:Writingasimplepublisherandsubscriber(C++)背景节点(Node)是通过ROS图进行通信的可执行进程。在本教程中,... 查看详情

python如何实现条形码和二维码制作?

参考技术Apython中专门有生成条形码和二维码的库,这里简单介绍一下实现过程,代码量不多,也很好理解,实验环境win10+python3.6+pycharm5.0,主要内容如下:制作条形码这里有2个库,分别是pybarcode和pystrich,可以直接根据输入的数... 查看详情

译13简单的优秀编码规则(从我15年的经验)(代码片段)

...编写代码的第一行之前,你应该明白它将要做什么,它将如何使用,模块,服务如何相互工作,它将有什么结构,如何进行测试和调试,以及如何更新。测试覆盖率测试是好事,但他们并不总是负担得起,对项目有意义。当你需... 查看详情

如何使用visualstudio2012的c++编写dll

...找到该硬件设备的驱动和SDK即开发手册开发手册会告诉你如何通过一些函数调用设备的各种功能,你需要做的就是做出程序的界面,按照设备的操作要求和流程拿到数据处理数据而已。开发手册一般还提供几个完整的实例本回答... 查看详情

GCC ARM 中的 C++ 构建警告,但不是 MS x86

】GCCARM中的C++构建警告,但不是MSx86【英文标题】:C++BuildwarninginGCCARMbutnotMSx86【发布时间】:2011-02-1212:22:16【问题描述】:我使用AirplaySDK,它是一个为智能手机构建C++应用程序的平台。它还有一个使用MSVisualC++IDE+编译器的x86模... 查看详情

c++文件简单读入读出测试(代码片段)

对于程序来说,不管后缀名如何,文件分为两种类型:文本文件和二进制文件。C语言里有一系列文件操作函数。区分文本和二进制文件,需要在打开文件时设置不同的控制符变量mode即可。fopen的函数原型:FILE... 查看详情

为 Windows x86 编写程序集

...令、寄存器的功能等有了相当好的理解,但对我来说程序如何与操作系统交互以及如何使用标准输入和输出仍然是个谜。我知 查看详情

x86 架构规范

...解它的工作原理。我需要的信息的一些示例:代码的结构如何(单条指令的大小,如何解包等)寄存器的具体工作原理关于单条指令作用的详细信息(例如CMP命令“比较...和...并设置标志”的默认描述对 查看详情

如何编写一个简单的调试器?

】如何编写一个简单的调试器?【英文标题】:Howtowriteasimpledebugger?【发布时间】:2011-04-1811:15:59【问题描述】:我想将我编译的目标代码连接到c++代码,然后检查是否执行了某行代码。这两件事怎么做?如果解释不简单(我敢... 查看详情

如何在 Linux 上执行适用于 x86、arm、GCC 和 icc 的原子操作?

】如何在Linux上执行适用于x86、arm、GCC和icc的原子操作?【英文标题】:HowtoperformatomicoperationsonLinuxthatworkonx86,arm,GCCandicc?【发布时间】:2011-01-1806:00:08【问题描述】:如今,每个现代操作系统都提供了一些原子操作:Windows有Interl... 查看详情

从x86到arm,代码移植指北

...很长时间,目前业内有口皆碑,因此基于x86环境编写的程序也都需要考虑迁移到ARM架构上去,以适应扑面而来的ARM热潮。针对这个迁移工作笔者进行了一些预研工作。从目前的情况看基于Java、Pyt 查看详情