EABI vs. ABI
C появлением roots, собраной EABI (extended application binary interface) тулчейном, появилась возможность сравнить — кто кого. Начитавшись вот этого, скачал тот же тест и собрал его в двух вариантах — для ABI и для EABI.
Получается, что при сборке с EABI операции с плавающей точкой выполняются почти в 20 (!!!) раз быстрее.
А вот и результаты:
ABI
root@b4-1060:~# time /tmp/bench
nTimes=93750 16: Dot with C code => (flops 1.010905 : time:2.96764 us)
nTimes=61225 16: Distance with C code => (flops 0.884803 : time:3.39061 us)
nTimes=46875 32: Dot with C code => (flops 1.036877 : time:2.8933 us)
nTimes=30928 32: Distance with C code => (flops 0.895203 : time:3.35121 us)
nTimes=23438 64: Dot with C code => (flops 1.047315 : time:2.86453 us)
nTimes=15545 64: Distance with C code => (flops 0.900703 : time:3.33094 us)
nTimes=11719 128: Dot with C code => (flops 1.051221 : time:2.85388 us)
nTimes=7793 128: Distance with C code => (flops 0.900334 : time:3.33244 us)
nTimes=5860 256: Dot with C code => (flops 1.053824 : time:2.84708 us)
nTimes=3902 256: Distance with C code => (flops 0.900956 : time:3.3305 us)
nTimes=2930 512: Dot with C code => (flops 1.056222 : time:2.84062 us)
nTimes=1952 512: Distance with C code => (flops 0.901215 : time:3.32909 us)
nTimes=1465 1024: Dot with C code => (flops 1.055056 : time:2.84376 us)
nTimes=977 1024: Distance with C code => (flops 0.902138 : time:3.32801 us)
nTimes=733 2048: Dot with C code => (flops 1.057055 : time:2.84032 us)
nTimes=489 2048: Distance with C code => (flops 0.902155 : time:3.33081 us)
nTimes=367 4096: Dot with C code => (flops 1.055699 : time:2.84784 us)
nTimes=245 4096: Distance with C code => (flops 0.902104 : time:3.33754 us)
nTimes=184 8192: Dot with C code => (flops 1.041046 : time:2.8958 us)
nTimes=123 8192: Distance with C code => (flops 0.895223 : time:3.37678 us)
nTimes=92 16384: Dot with C code => (flops 1.038325 : time:2.90338 us)
nTimes=62 16384: Distance with C code => (flops 0.894962 : time:3.40516 us)
nTimes=46 32768: Dot with C code => (flops 1.037456 : time:2.90581 us)
nTimes=31 32768: Distance with C code => (flops 0.894909 : time:3.40532 us)
nTimes=23 65536: Dot with C code => (flops 1.037022 : time:2.90703 us)
nTimes=16 65536: Distance with C code => (flops 0.894440 : time:3.517 us)
16, 1.010905, 0.884803,
32, 1.036877, 0.895203,
64, 1.047315, 0.900703,
128, 1.051221, 0.900334,
256, 1.053824, 0.900956,
512, 1.056222, 0.901215,
1024, 1.055056, 0.902138,
2048, 1.057055, 0.902155,
4096, 1.055699, 0.902104,
8192, 1.041046, 0.895223,
16384, 1.038325, 0.894962,
32768, 1.037456, 0.894909,
65536, 1.037022, 0.894440,
real 1m 22.50s
user 0m 3.99s
sys 1m 18.45s
EABI
/var/volatile/tmp # time ./bench
nTimes=93750 16: Dot with C code => (flops 19.486593 : time:0.153952 us)
nTimes=61225 16: Distance with C code => (flops 9.450713 : time:0.317439 us)
nTimes=46875 32: Dot with C code => (flops 19.973768 : time:0.150197 us)
nTimes=30928 32: Distance with C code => (flops 10.363859 : time:0.289469 us)
nTimes=23438 64: Dot with C code => (flops 20.970230 : time:0.143063 us)
nTimes=15545 64: Distance with C code => (flops 10.961742 : time:0.273696 us)
nTimes=11719 128: Dot with C code => (flops 20.730844 : time:0.144715 us)
nTimes=7793 128: Distance with C code => (flops 11.237518 : time:0.26699 us)
nTimes=5860 256: Dot with C code => (flops 20.988890 : time:0.142948 us)
nTimes=3902 256: Distance with C code => (flops 11.361018 : time:0.264117 us)
nTimes=2930 512: Dot with C code => (flops 21.430246 : time:0.140004 us)
nTimes=1952 512: Distance with C code => (flops 11.455783 : time:0.261896 us)
nTimes=1465 1024: Dot with C code => (flops 21.553713 : time:0.139202 us)
nTimes=977 1024: Distance with C code => (flops 11.485500 : time:0.261401 us)
nTimes=733 2048: Dot with C code => (flops 21.468487 : time:0.13985 us)
nTimes=489 2048: Distance with C code => (flops 11.531381 : time:0.260585 us)
nTimes=367 4096: Dot with C code => (flops 21.114143 : time:0.142391 us)
nTimes=245 4096: Distance with C code => (flops 11.550122 : time:0.260673 us)
nTimes=184 8192: Dot with C code => (flops 20.601624 : time:0.146331 us)
nTimes=123 8192: Distance with C code => (flops 11.123475 : time:0.271765 us)
nTimes=92 16384: Dot with C code => (flops 17.530840 : time:0.171963 us)
nTimes=62 16384: Distance with C code => (flops 10.677835 : time:0.285403 us)
nTimes=46 32768: Dot with C code => (flops 17.464016 : time:0.172621 us)
nTimes=31 32768: Distance with C code => (flops 9.748456 : time:0.312609 us)
nTimes=23 65536: Dot with C code => (flops 17.510881 : time:0.172159 us)
nTimes=16 65536: Distance with C code => (flops 10.612705 : time:0.296413 us)
16, 19.486593, 9.450713,
32, 19.973768, 10.363859,
64, 20.970230, 10.961742,
128, 20.730844, 11.237518,
256, 20.988890, 11.361018,
512, 21.430246, 11.455783,
1024, 21.553713, 11.485500,
2048, 21.468487, 11.531381,
4096, 21.114143, 11.550122,
8192, 20.601624, 11.123475,
16384, 17.530840, 10.677835,
32768, 17.464016, 9.748456,
65536, 17.510881, 10.612705,
real 0m 5.73s
user 0m 5.71s
sys 0m 0.02s
вах! вот бы ещё картинку с графиками сюда. для улучшенного эстетического восприятия (awk + gnuplot) ;)