Цитата(VAI @ Aug 1 2013, 21:45)

... и выложите результат. :-)
Да, вот результат.
Уменьшил массив до 31 отсчета, под алгоритм VAI. Количество итераций довел до 10000.
И сделал сравнение для двух компиляторов Keil (ARM compiler) и IAR.
Чтобы еще было больше доверия к тесту и виднее различие компиляторов вначале идет тест CoreMark.
CODE
INVCPU v1.00 PCB Test Suit. INVCPU v1.00 PCB Test Suit.
System Core Clock = 120000000 Hz System Core Clock = 120000000 Hz
Now. System ticks = 750122l, Sysytem time = 0.006251 s Now. System ticks = 707843l, Sysytem time = 0.005899 s
---------------------------------------------- ----------------------------------------------
Coremark test Coremark test
---------------------------------------------- ----------------------------------------------
2K performance run parameters for coremark. 2K performance run parameters for coremark
CoreMark Size : 666 CoreMark Size : 666
Total ticks : 2090014320 Total ticks : 1619555180
Total time (secs): 17.416786 Total time (secs): 13.496293
Iterations/Sec : 287.079373 Iterations/Sec : 370.472095
Iterations : 5000 Iterations : 5000
Compiler version : ARM CC 5030069 Compiler version : IAR CC 6050006
Compiler flags : -o3 Compiler flags : -o3
Memory location : STACK Memory location : STACK
seedcrc : 0xe9f5 seedcrc : 0xe9f5
[0]crclist : 0xe714 [0]crclist : 0xe714
[0]crcmatrix : 0x1fd7 [0]crcmatrix : 0x1fd7
[0]crcstate : 0x8e3a [0]crcstate : 0x8e3a
[0]crcfinal : 0xbd59 [0]crcfinal : 0xbd59
Correct operation validated. Correct operation validated.
CoreMark 1.0 : 287.079373 / ARM CC 5030069 -o3 / STACK CoreMark 1.0 : 370.472095 / IAR CC 6050006 -o3 / STACK
---------------------------------------------- ----------------------------------------------
Algorithm 'Qsort' (standart C library ): Algorithm 'Qsort' (standart C library ):
---------------------------------------------- ----------------------------------------------
Results CRC = 81AD Results CRC = 7CBB
Number of samplles = 31 Number of samplles = 31
Number of iterations = 10000 Number of iterations = 10000
Measured max. number of cycles = 6452, time(us)=53.77 Measured max. number of cycles = 12865, time(us)=107.21
Measured min. number of cycles = 3722, time(us)=31.02 Measured min. number of cycles = 6340, time(us)=52.83
Measured aver.number of cycles = 4788, time(us)=39.90 Measured aver.number of cycles = 8508, time(us)=70.90
---------------------------------------------- ----------------------------------------------
Algorithm 'Shell' Algorithm 'Shell' (http://electronix.ru/forum/index.php?s=&showtopic=114436&view=findpost&p=1181687):
---------------------------------------------- ----------------------------------------------
Results CRC = 81AD Results CRC = 7CBB
Number of samplles = 31 Number of samplles = 31
Number of iterations = 10000 Number of iterations = 10000
Measured max. number of cycles = 2372, time(us)=19.77 Measured max. number of cycles = 2610, time(us)=21.75
Measured min. number of cycles = 1355, time(us)=11.29 Measured min. number of cycles = 1565, time(us)=13.04
Measured aver.number of cycles = 1949, time(us)=16.24 Measured aver.number of cycles = 2098, time(us)=17.48
---------------------------------------------- ----------------------------------------------
Algorithm 'Select' Algorithm 'Select' (Numerical Recipes in C, 8.5 Selecting the Mth Largest p.341):
---------------------------------------------- ----------------------------------------------
Results CRC = 81AD Results CRC = 7CBB
Number of samplles = 31 Number of samplles = 31
Number of iterations = 10000 Number of iterations = 10000
Measured max. number of cycles = 1453, time(us)=12.11 Measured max. number of cycles = 1530, time(us)=12.75
Measured min. number of cycles = 472, time(us)=3.93 Measured min. number of cycles = 495, time(us)=4.13
Measured aver.number of cycles = 825, time(us)=6.88 Measured aver.number of cycles = 858, time(us)=7.15
---------------------------------------------- ----------------------------------------------
Algorithm 'Selip' Algorithm 'Selip' (Numerical Recipes in C, 8.5 Selecting the Mth Largest p.343):
---------------------------------------------- ----------------------------------------------
Results CRC = 81AD Results CRC = 7CBB
Number of samplles = 31 Number of samplles = 31
Number of iterations = 10000 Number of iterations = 10000
Measured max. number of cycles = 3325, time(us)=27.71 Measured max. number of cycles = 3590, time(us)=29.92
Measured min. number of cycles = 1090, time(us)=9.08 Measured min. number of cycles = 1170, time(us)=9.75
Measured aver.number of cycles = 2957, time(us)=24.64 Measured aver.number of cycles = 3266, time(us)=27.22
---------------------------------------------- ----------------------------------------------
Algorithm 'Xenia' Algorithm 'Xenia' (http://electronix.ru/forum/index.php?s=&showtopic=114436&view=findpost&p=1180687):
---------------------------------------------- ----------------------------------------------
Results CRC = 81AD Results CRC = 7CBB
Number of samplles = 31 Number of samplles = 31
Number of iterations = 10000 Number of iterations = 10000
Measured max. number of cycles = 5375, time(us)=44.79 Measured max. number of cycles = 5340, time(us)=44.50
Measured min. number of cycles = 469, time(us)=3.91 Measured min. number of cycles = 474, time(us)=3.95
Measured aver.number of cycles = 2947, time(us)=24.56 Measured aver.number of cycles = 2766, time(us)=23.05
---------------------------------------------- ----------------------------------------------
Algorithm 'Neiver' Algorithm 'Neiver' (http://electronix.ru/forum/index.php?s=&showtopic=114436&view=findpost&p=1180944):
---------------------------------------------- ----------------------------------------------
Results CRC = 81AD Results CRC = 7CBB
Number of samplles = 31 Number of samplles = 31
Number of iterations = 10000 Number of iterations = 10000
Measured max. number of cycles = 3014, time(us)=25.12 Measured max. number of cycles = 2540, time(us)=21.17
Measured min. number of cycles = 754, time(us)=6.28 Measured min. number of cycles = 681, time(us)=5.68
Measured aver.number of cycles = 761, time(us)=6.34 Measured aver.number of cycles = 695, time(us)=5.79
---------------------------------------------- ----------------------------------------------
Algorithm 'Ekstrom' Algorithm 'Ekstrom' (http://embeddedgurus.com/stack-overflow/tag/median-filter/):
---------------------------------------------- ----------------------------------------------
Results CRC = 81AD Results CRC = 7CBB
Number of samplles = 31 Number of samplles = 31
Number of iterations = 10000 Number of iterations = 10000
Measured max. number of cycles = 694, time(us)=5.78 Measured max. number of cycles = 637, time(us)=5.31
Measured min. number of cycles = 632, time(us)=5.27 Measured min. number of cycles = 563, time(us)=4.69
Measured aver.number of cycles = 637, time(us)=5.31 Measured aver.number of cycles = 574, time(us)=4.78
---------------------------------------------- ----------------------------------------------
Algorithm 'Klen' Algorithm 'Klen' (http://electronix.ru/forum/index.php?s=&showtopic=114436&view=findpost&p=1180679)
---------------------------------------------- ----------------------------------------------
Results CRC = 81AD Results CRC = 7CBB
Number of samplles = 31 Number of samplles = 31
Number of iterations = 10000 Number of iterations = 10000
Measured max. number of cycles = 1967, time(us)=16.39 Measured max. number of cycles = 7120, time(us)=59.33
Measured min. number of cycles = 822, time(us)=6.85 Measured min. number of cycles = 2580, time(us)=21.50
Measured aver.number of cycles = 1169, time(us)=9.74 Measured aver.number of cycles = 4260, time(us)=35.50
---------------------------------------------- ----------------------------------------------
Algorithm 'VAI' (http://caxapa.ru/170626.html): Algorithm 'VAI' (http://caxapa.ru/170626.html):
---------------------------------------------- ----------------------------------------------
Results CRC = 81AD Results CRC = 7CBB
Number of samplles = 31 Number of samplles = 31
Number of iterations = 10000 Number of iterations = 10000
Measured max. number of cycles = 5707, time(us)=47.56 Measured max. number of cycles = 4627, time(us)=38.56
Measured min. number of cycles = 5650, time(us)=47.08 Measured min. number of cycles = 4549, time(us)=37.91
Measured aver.number of cycles = 5652, time(us)=47.10 Measured aver.number of cycles = 4562, time(us)=38.02
С шаблонами на C++ в обоих компиляторах наблюдаются проблемы.
Keil при наличии шаблонов отказывается делать кроссмодульную оптимизацию. IAR как видно с шаблонами тоже жутко затормозил быстродействие.
Вообщем шаблоны не наш путь.

Проекты для микроконтроллера MK60FN1M0VLQ12 здесь:
[attachment=78643:Test_Suite_IAR.zip]
[attachment=78644:Test_Suite_Keil.zip]
Сообщение отредактировал IgorKossak - Aug 1 2018, 17:18
Причина редактирования: [codebox] для длинного кода, [code] - для короткого!