Comparison of compilers for development on microcontrollers with the ARM Cortex-M core


    In this article, we test the 3rd compiler for Kinetis microcontrollers with the ARM Cortex-M4 core .
    Run the tests CoreMark , Whetstone , Dhrystone .
    We study compression algorithms with minimal RAM consumption and find out how different compilers affect their performance.
    And we ’ll even try to find out how far Kinetis is behind in performance from Intel Core I7 .




    Previous articles on development on Kinetis microcontrollers:



    In the article “Start of development on Kinetis microcontrollers. Quick Start ” was described the development environment Kinetis Design Studio v3.0.0 (KDS) . Wednesday KDS uses as a tool to compile and build the software package the GNU for the Tools on ARM Embedded Processors . This includes the GCC compiler for ARM in particular . The compiler is not bad in every sense. But if we look at how many branches he has in the gcc.gnu.org/svn/gcc/branches directory , then we will see more than 300 of them! How much effort is needed to support such a huge number of branches !? But the project is not commercial. On the other hand, the ARM Cortex-M seriesnot mainstream, not used on smartphones, they have not attracted so much attention from the community that supports Open Source.

    This all makes you think, especially if you intend to get involved in the long and exhausting programming of microcontrollers with megabytes of impenetrable sources, limited memory space, unknown requirements but with a lightning reaction to their changes.

    Fortunately, KDS is provided with plugins for converting to other well-known compilation and assembly packages - Keil and IAR . Most of the demo projects for Kinetis are accompanied by 3 configurations for building tools GCC , Keil and IAR . However in the software suite forKinetis is not a comprehensive test enough to compare these compilation tools with each other. Therefore, I had to create my own.
    The project was created in KDS using the ProcessorExpert plug-in for the MK60FN1M0VLQ12 microcontroller on the board presented in the article “Smart board for controlling 3-phase power loads”

    Here is the project screen in KDS :


    What is included in the test suite


    Whetstone project . A very old and simple floating point performance test. The test is very easy to port and can be performed on simple microcontrollers. In our case, two implementations are presented: a calculation option with a float typeand a variant with a double type. This is important because in the first case, the Cortex-M4 uses a coprocessor, while in the second it does not.

    Dhrystone project . Performance test of integer operations. The float and double typesare not used anywhere. The test is also easy to port and there is a huge archive of results for all kinds of microcontrollers and computers.

    CoreMark Project. A modern test specifically designed for embedded systems. May become an industry standard. Its results are certified by EEMBC , and therefore protected to some extent from cheating and falsification.
    The results of the CoreMark test are the most credible in the comprehensive testing of microcontroller performance and compiler comparison. On it, in principle, it would be possible to limit it, but the tests themselves do not have any practical benefit for embedded applications, and to give more practical value to these tests, I added more testing of compression algorithms.

    First I had to find a suitable memory manager (heap manager or heap).

    Umm_malloc project . Found on Github. In appearance it seemed quite suitable. The standard heap manager from the C library, and I refused to use for two reasons. Firstly, each of the Keil , IAR , GCC environments will have its own heap library and did not want to spend time researching the features of each of them. Secondly, compression algorithms are critically dependent on the amount of memory allocated to them. A memory barely enough. We needed a mechanism for precise control of allocated memory. And here umm_malloc provides such an opportunity. And along the way, we will test the performance of the umm_malloc algorithm itself .

    Compression algorithms


    All the algorithms had to be adjusted in order to use as little RAM as possible.
    How much memory these algorithms need, how much they can compress the data, and what their performance can be found in the test results and in the listing of output to the terminal.

    And here are the results:


    -All compilers had the option of maximum optimization enabled. The exact composition of the options can be found in the attached project.
    -Compression algorithms compressed a section of the binary firmware code obtained from the project of this test compiled in the IAR.
    -GCC compile time measured when compiling from KDS.
    -In addition to the speed of the algorithms, lines are also inserted in the table with additional metrics that are important for the developer, these are: the time the project is completely recompiled, the size of the binary file when optimizing for speed, and the size of the binary file when optimizing for size.

    Output to the terminal of the test results compiled in IAR
    ----------- Speed Test -------------
    Reference time = 100001 us
    ----------- umm malloc test -------------
    ...........................................................
    |0x1fff1b44|B     0|NB     1|PB     0|Z     1|NF     1|PF     0|USED
    |0x1fff1b4c|B     1|NB  4223|PB     0|Z  4222|NF  4223|PF     0|FREE
    |0x1fff9f3c|B  4223|NB     0|PB     1|Z     1|NF     0|PF     1|USED
    ...........................................................
    Total Entries     1    Used Entries      0    Free Entries      1
    Total Blocks   4223    Used Blocks       0    Free Blocks    4223
                           Used space =      0    Free space =  33784
    ...........................................................
    umm malloc test   time  = 1447071 uS
    Allocations =  40000, uSec per allocation = 36
    ----------- Compressor LZSS test -------------
    Uncompressed size = 2048
    Compressed   size = 1858. Max. alloc.= 14384. Time = 6627 uS
    Decompress                Max. alloc.= 1048. Time = 981 uS
    Decompress Ok!
    ----------- Compressor Zlib test -------------
    Uncompressed size = 2048
    Compressed   size = 1740. Max. alloc.= 24288. Time = 12179 uS
    Decompress                Max. alloc.= 15768. Time = 764 uS
    Decompress Ok!
    ----------- Compressor S-LZW test -------------
    Uncompressed size = 2048
    Compressed   size = 2035. Max. alloc.= 4320. Time = 2542 uS
    Decompress                Max. alloc.= 4320. Time = 3816 uS
    Decompress Ok!
    ----------- Compressor FastLZ test -------------
    Uncompressed size = 2048
    Compressed   size = 1834. Max. alloc.= 32776. Time = 1010 uS
    Decompress                Max. alloc.= 0. Time = 152 uS
    Decompress Ok!
    ----------- WHETSTONE FLOAT -------------
    .........MODULE 1:  simple identifiers...
      xx1  = -0.06679254770278930664
      xx2  = -0.46633863449096679688
      xx3  = -0.73303699493408203125
      xx4  = -1.13254797458648681641
    .........MODULE 2:  array elements.......
      e10  = -0.06834230571985244751
      e11  = -0.46263590455055236816
      e12  = -0.72971796989440917969
      e13  = -1.12397670745849609375
    .........MODULE 3:  array as parameter...
      e1_0 = -0.05533060804009437561
      e1_1 = -0.44743216037750244141
      e1_2 = -0.71096724271774291992
      e1_3 = -1.10309338569641113281
    .........MODULE 4:  conditional jumps....
      val  = 1
    .........MODULE 6:  integer arithmetic...
      e1k  = 6.00000000000000000000
      e1l  = 6.00000000000000000000
    .........MODULE 7:  trig. functions......
      x1   = 0.49041154980659484863
      y1   = 0.49039667844772338867
    .........MODULE 8:  procedure calls......
      z    = 0.99993747472763061523
    .........MODULE9:  array references......
      e1_j = -1.10309338569641113281
      e1_k = 3.00000000000000000000
      e1_l = -1.10309338569641113281
    .........MODULE10:  integer arithmetic...
      j    = 2
      k    = 3
    .........MODULE11:  standard functions...
      x    = 0.83466047048568725586
    ........................................
    Whetstone last    time (uS) = 10960.00
    Whetstone max     time (uS) = 10961.00
    Whetstone min     time (uS) = 10960.00
    ----------- WHETSTONE DOUBLE -------------
    .........MODULE 1:  simple identifiers...
      xx1  = -0.06679268039452399826
      xx2  = -0.46633881454398036003
      xx3  = -0.73303694842681344599
      xx4  = -1.13254799829068817198
    .........MODULE 2:  array elements.......
      e10  = -0.06834219862995164003
      e11  = -0.46263765626356890425
      e12  = -0.72971838784369053319
      e13  = -1.12397907004612833261
    .........MODULE 3:  array as parameter...
      e1_0 = -0.05533645259179445915
      e1_1 = -0.44743656275474680588
      e1_2 = -0.71097338928518248722
      e1_3 = -1.10309805692560095340
    .........MODULE 4:  conditional jumps....
      val  = 1
    .........MODULE 6:  integer arithmetic...
      e1k  = 6.00000000000000000000
      e1l  = 6.00000000000000000000
    .........MODULE 7:  trig. functions......
      x1   = 0.49040731615907084197
      y1   = 0.49039249795612543821
    .........MODULE 8:  procedure calls......
      z    = 0.99993750062499996275
    .........MODULE9:  array references......
      e1_j = -1.10309805692560095340
      e1_k = 3.00000000000000000000
      e1_l = -1.10309805692560095340
    .........MODULE10:  integer arithmetic...
      j    = 2
      k    = 3
    .........MODULE11:  standard functions...
      x    = 0.83466551951904967427
    ........................................
    Whetstone last    time (uS) = 142583.00
    Whetstone max     time (uS) = 142583.00
    Whetstone min     time (uS) = 142582.00
    ----------- DHRYSTONE 2 -------------
    Dhrystone Benchmark, Version 2.1 (Language: C)
    Program compiled without 'register' attribute
    Execution starts, 20000 runs through Dhrystone
                                                  Execution ends
    Final values of the variables used in the benchmark:
    Int_Glob:            5
            should be:   5
    Bool_Glob:           1
            should be:   1
    Ch_1_Glob:           A
            should be:   A
    Ch_2_Glob:           B
            should be:   B
    Arr_1_Glob[8]:       7
            should be:   7
    Arr_2_Glob[8][7]:    20010
            should be:   Number_Of_Runs + 10
    Ptr_Glob->
      Ptr_Comp:          536867932
            should be:   (implementation-dependent)
      Discr:             0
            should be:   0
      Enum_Comp:         2
            should be:   2
      Int_Comp:          17
            should be:   17
      Str_Comp:          DHRYSTONE PROGRAM, SOME STRING
            should be:   DHRYSTONE PROGRAM, SOME STRING
    Next_Ptr_Glob->
      Ptr_Comp:          536867932
            should be:   (implementation-dependent), same as above
      Discr:             0
            should be:   0
      Enum_Comp:         1
            should be:   1
      Int_Comp:          18
            should be:   18
      Str_Comp:          DHRYSTONE PROGRAM, SOME STRING
            should be:   DHRYSTONE PROGRAM, SOME STRING
    Int_1_Loc:           5
            should be:   5
    Int_2_Loc:           13
            should be:   13
    Int_3_Loc:           7
            should be:   7
    Enum_Loc:            1
            should be:   1
    Str_1_Loc:           DHRYSTONE PROGRAM, 1'ST STRING
            should be:   DHRYSTONE PROGRAM, 1'ST STRING
    Str_2_Loc:           DHRYSTONE PROGRAM, 2'ND STRING
            should be:   DHRYSTONE PROGRAM, 2'ND STRING
    Time = 93000 us
    Microseconds for one run through Dhrystone: 4.65
    Dhrystones per Second:                      215053
    ----------- COREMARK -------------
    2K performance run parameters for coremark.
    CoreMark Size    : 666
    Total ticks      : 29079282
    Total time (secs): 29.079282
    Iterations/Sec   : 343.887445
    Iterations       : 10000
    Compiler version : IAR 7.40.7
    Compiler flags   :  -O3 -Otime
    Memory location  : IRAM
    seedcrc          : 0xe9f5
    [0]crclist       : 0xe714
    [0]crcmatrix     : 0x1fd7
    [0]crcstate      : 0x8e3a
    [0]crcfinal      : 0x988c
    Correct operation validated. See readme.txt for run and reporting rules.
    CoreMark 1.0 : 343.887445 / IAR 7.40.7  -O3 -Otime / IRAM
    END.
    


    Output to the terminal the results of a test compiled in Keil
    ----------- Speed Test -------------
    Reference time = 100001 us
    ----------- umm malloc test -------------
    ...........................................................
    |0x1fff60f8|B     0|NB     1|PB     0|Z     1|NF     1|PF     0|USED
    |0x1fff6100|B     1|NB  4223|PB     0|Z  4222|NF  4223|PF     0|FREE
    |0x1fffe4f0|B  4223|NB     0|PB     1|Z     1|NF     0|PF     1|USED
    ...........................................................
    Total Entries     1    Used Entries      0    Free Entries      1
    Total Blocks   4223    Used Blocks       0    Free Blocks    4223
                           Used space =      0    Free space =  33784
    ...........................................................
    umm malloc test   time  = 1507118 uS
    Allocations =  40000, uSec per allocation = 37
    ----------- Compressor LZSS test -------------
    Uncompressed size = 2048
    Compressed   size = 1858. Max. alloc.= 14384. Time = 7406 uS
    Decompress                Max. alloc.= 1048. Time = 989 uS
    Decompress Ok!
    ----------- Compressor Zlib test -------------
    Uncompressed size = 2048
    Compressed   size = 1740. Max. alloc.= 24288. Time = 11716 uS
    Decompress                Max. alloc.= 15768. Time = 912 uS
    Decompress Ok!
    ----------- Compressor S-LZW test -------------
    Uncompressed size = 2048
    Compressed   size = 2035. Max. alloc.= 4320. Time = 2839 uS
    Decompress                Max. alloc.= 4320. Time = 4194 uS
    Decompress Ok!
    ----------- Compressor FastLZ test -------------
    Uncompressed size = 2048
    Compressed   size = 1834. Max. alloc.= 32776. Time = 1028 uS
    Decompress                Max. alloc.= 0. Time = 160 uS
    Decompress Ok!
    ----------- WHETSTONE FLOAT -------------
    .........MODULE 1:  simple identifiers...
      xx1  = -0.06679254770278930700
      xx2  = -0.46633863449096680000
      xx3  = -0.73303699493408203000
      xx4  = -1.13254797458648680000
    .........MODULE 2:  array elements.......
      e10  = -0.06834230571985244800
      e11  = -0.46263590455055237000
      e12  = -0.72971796989440918000
      e13  = -1.12397670745849610000
    .........MODULE 3:  array as parameter...
      e1_0 = -0.05533060804009437600
      e1_1 = -0.44743216037750244000
      e1_2 = -0.71096724271774292000
      e1_3 = -1.10309338569641110000
    .........MODULE 4:  conditional jumps....
      val  = 1
    .........MODULE 6:  integer arithmetic...
      e1k  = 6.00000000000000000000
      e1l  = 6.00000000000000000000
    .........MODULE 7:  trig. functions......
      x1   = 0.49040567874908447000
      y1   = 0.49039086699485779000
    .........MODULE 8:  procedure calls......
      z    = 0.99993747472763062000
    .........MODULE9:  array references......
      e1_j = -1.10309338569641110000
      e1_k = 3.00000000000000000000
      e1_l = -1.10309338569641110000
    .........MODULE10:  integer arithmetic...
      j    = 2
      k    = 3
    .........MODULE11:  standard functions...
      x    = 0.83466011285781860000
    ........................................
    Whetstone last    time (uS) = 08925.00
    Whetstone max     time (uS) = 08926.00
    Whetstone min     time (uS) = 08925.00
    ----------- WHETSTONE DOUBLE -------------
    .........MODULE 1:  simple identifiers...
      xx1  = -0.06679268039452399000
      xx2  = -0.46633881454398041000
      xx3  = -0.73303694842681344000
      xx4  = -1.13254799829068810000
    .........MODULE 2:  array elements.......
      e10  = -0.06834219862995163900
      e11  = -0.46263765626356895000
      e12  = -0.72971838784369047000
      e13  = -1.12397907004612830000
    .........MODULE 3:  array as parameter...
      e1_0 = -0.05533645259179446200
      e1_1 = -0.44743656275474680000
      e1_2 = -0.71097338928518250000
      e1_3 = -1.10309805692560080000
    .........MODULE 4:  conditional jumps....
      val  = 1
    .........MODULE 6:  integer arithmetic...
      e1k  = 6.00000000000000000000
      e1l  = 6.00000000000000000000
    .........MODULE 7:  trig. functions......
      x1   = 0.49040731615903904000
      y1   = 0.49039249795609352000
    .........MODULE 8:  procedure calls......
      z    = 0.99993750062499998000
    .........MODULE9:  array references......
      e1_j = -1.10309805692560080000
      e1_k = 3.00000000000000000000
      e1_l = -1.10309805692560080000
    .........MODULE10:  integer arithmetic...
      j    = 2
      k    = 3
    .........MODULE11:  standard functions...
      x    = 0.83466551951905033000
    ........................................
    Whetstone last    time (uS) = 166298.00
    Whetstone max     time (uS) = 166298.00
    Whetstone min     time (uS) = 166298.00
    ----------- DHRYSTONE 2 -------------
    Dhrystone Benchmark, Version 2.1 (Language: C)
    Program compiled without 'register' attribute
    Execution starts, 20000 runs through Dhrystone
                                                  Execution ends
    Final values of the variables used in the benchmark:
    Int_Glob:            5
            should be:   5
    Bool_Glob:           1
            should be:   1
    Ch_1_Glob:           A
            should be:   A
    Ch_2_Glob:           B
            should be:   B
    Arr_1_Glob[8]:       7
            should be:   7
    Arr_2_Glob[8][7]:    20010
            should be:   Number_Of_Runs + 10
    Ptr_Glob->
      Ptr_Comp:          536870816
            should be:   (implementation-dependent)
      Discr:             0
            should be:   0
      Enum_Comp:         2
            should be:   2
      Int_Comp:          17
            should be:   17
      Str_Comp:          DHRYSTONE PROGRAM, SOME STRING
            should be:   DHRYSTONE PROGRAM, SOME STRING
    Next_Ptr_Glob->
      Ptr_Comp:          536870816
            should be:   (implementation-dependent), same as above
      Discr:             0
            should be:   0
      Enum_Comp:         1
            should be:   1
      Int_Comp:          18
            should be:   18
      Str_Comp:          DHRYSTONE PROGRAM, SOME STRING
            should be:   DHRYSTONE PROGRAM, SOME STRING
    Int_1_Loc:           5
            should be:   5
    Int_2_Loc:           13
            should be:   13
    Int_3_Loc:           7
            should be:   7
    Enum_Loc:            1
            should be:   1
    Str_1_Loc:           DHRYSTONE PROGRAM, 1'ST STRING
            should be:   DHRYSTONE PROGRAM, 1'ST STRING
    Str_2_Loc:           DHRYSTONE PROGRAM, 2'ND STRING
            should be:   DHRYSTONE PROGRAM, 2'ND STRING
    Time = 91000 us
    Microseconds for one run through Dhrystone: 4.55
    Dhrystones per Second:                      219780
    ----------- COREMARK -------------
    2K performance run parameters for coremark.
    CoreMark Size    : 666
    Total ticks      : 37386523
    Total time (secs): 37.386523
    Iterations/Sec   : 267.476064
    Iterations       : 10000
    Compiler version : armcc V5.06 (build 20)
    Compiler flags   :  -O3 -Otime
    Memory location  : IRAM
    seedcrc          : 0xe9f5
    [0]crclist       : 0xe714
    [0]crcmatrix     : 0x1fd7
    [0]crcstate      : 0x8e3a
    [0]crcfinal      : 0x988c
    Correct operation validated. See readme.txt for run and reporting rules.
    CoreMark 1.0 : 267.476064 / armcc V5.06 (build 20)  -O3 -Otime / IRAM
    END.
    


    Output to the terminal the results of a test compiled in GCC
    ----------- Speed Test -------------
    Reference time = 100001 us
    ----------- umm malloc test -------------
    ...........................................................
    |0x1fff5280|B     0|NB     1|PB     0|Z     1|NF     1|PF     0|USED
    |0x1fff5288|B     1|NB  4223|PB     0|Z  4222|NF  4223|PF     0|FREE
    |0x1fffd678|B  4223|NB     0|PB     1|Z     1|NF     0|PF     1|USED
    ...........................................................
    Total Entries     1    Used Entries      0    Free Entries      1
    Total Blocks   4223    Used Blocks       0    Free Blocks    4223
                           Used space =      0    Free space =  33784
    ...........................................................
    umm malloc test   time  = 983944 uS
    Allocations =  40000, uSec per allocation = 24
    ----------- Compressor LZSS test -------------
    Uncompressed size = 2048
    Compressed   size = 1858. Max. alloc.= 14384. Time = 8504 uS
    Decompress                Max. alloc.= 1048. Time = 673 uS
    Decompress Ok!
    ----------- Compressor Zlib test -------------
    Uncompressed size = 2048
    Compressed   size = 1740. Max. alloc.= 24288. Time = 12384 uS
    Decompress                Max. alloc.= 15768. Time = 1070 uS
    Decompress Ok!
    ----------- Compressor S-LZW test -------------
    Uncompressed size = 2048
    Compressed   size = 2035. Max. alloc.= 4320. Time = 2577 uS
    Decompress                Max. alloc.= 4320. Time = 4189 uS
    Decompress Ok!
    ----------- Compressor FastLZ test -------------
    Uncompressed size = 2048
    Compressed   size = 1834. Max. alloc.= 32776. Time = 1045 uS
    Decompress                Max. alloc.= 0. Time = 234 uS
    Decompress Ok!
    ----------- WHETSTONE FLOAT -------------
    .........MODULE 1:  simple identifiers...
      xx1  = -0.06679254770278930664
      xx2  = -0.46633863449096679688
      xx3  = -0.73303699493408203125
      xx4  = -1.13254797458648681641
    .........MODULE 2:  array elements.......
      e10  = -0.06834230571985244751
      e11  = -0.46263590455055236816
      e12  = -0.72971796989440917969
      e13  = -1.12397670745849609375
    .........MODULE 3:  array as parameter...
      e1_0 = -0.05533138290047645569
      e1_1 = -0.44743290543556213379
      e1_2 = -0.71096915006637573242
      e1_3 = -1.10309529304504394531
    .........MODULE 4:  conditional jumps....
      val  = 1
    .........MODULE 6:  integer arithmetic...
      e1k  = 6.00000000000000000000
      e1l  = 6.00000000000000000000
    .........MODULE 7:  trig. functions......
      x1   = 0.49040564894676208496
      y1   = 0.49039086699485778809
    .........MODULE 8:  procedure calls......
      z    = 0.99993747472763061523
    .........MODULE9:  array references......
      e1_j = -1.10309529304504394531
      e1_k = 3.00000000000000000000
      e1_l = -1.10309529304504394531
    .........MODULE10:  integer arithmetic...
      j    = 2
      k    = 3
    .........MODULE11:  standard functions...
      x    = 0.83466064929962158203
    ........................................
    Whetstone last    time (uS) = 13629.00
    Whetstone max     time (uS) = 13630.00
    Whetstone min     time (uS) = 13629.00
    ----------- WHETSTONE DOUBLE -------------
    .........MODULE 1:  simple identifiers...
      xx1  = -0.06679268039452398997
      xx2  = -0.46633881454398040667
      xx3  = -0.73303694842681343946
      xx4  = -1.13254799829068808492
    .........MODULE 2:  array elements.......
      e10  = -0.06834219862995163930
      e11  = -0.46263765626356895266
      e12  = -0.72971838784369047470
      e13  = -1.12397907004612829240
    .........MODULE 3:  array as parameter...
      e1_0 = -0.05533645259179446191
      e1_1 = -0.44743656275474680273
      e1_2 = -0.71097338928518249990
      e1_3 = -1.10309805692560081170
    .........MODULE 4:  conditional jumps....
      val  = 1
    .........MODULE 6:  integer arithmetic...
      e1k  = 6.00000000000000000000
      e1l  = 6.00000000000000000000
    .........MODULE 7:  trig. functions......
      x1   = 0.49040731615904653573
      y1   = 0.49039249795610123650
    .........MODULE 8:  procedure calls......
      z    = 0.99993750062499997533
    .........MODULE9:  array references......
      e1_j = -1.10309805692560081170
      e1_k = 3.00000000000000000000
      e1_l = -1.10309805692560081170
    .........MODULE10:  integer arithmetic...
      j    = 2
      k    = 3
    .........MODULE11:  standard functions...
      x    = 0.83466551951905032514
    ........................................
    Whetstone last    time (uS) = 219895.00
    Whetstone max     time (uS) = 219895.00
    Whetstone min     time (uS) = 219894.00
    ----------- DHRYSTONE 2 -------------
    Dhrystone Benchmark, Version 2.1 (Language: C)
    Program compiled without 'register' attribute
    Execution starts, 20000 runs through Dhrystone
                                                  Execution ends
    Final values of the variables used in the benchmark:
    Int_Glob:            5
            should be:   5
    Bool_Glob:           1
            should be:   1
    Ch_1_Glob:           A
            should be:   A
    Ch_2_Glob:           B
            should be:   B
    Arr_1_Glob[8]:       7
            should be:   7
    Arr_2_Glob[8][7]:    20010
            should be:   Number_Of_Runs + 10
    Ptr_Glob->
      Ptr_Comp:          536870792
            should be:   (implementation-dependent)
      Discr:             0
            should be:   0
      Enum_Comp:         2
            should be:   2
      Int_Comp:          17
            should be:   17
      Str_Comp:          DHRYSTONE PROGRAM, SOME STRING
            should be:   DHRYSTONE PROGRAM, SOME STRING
    Next_Ptr_Glob->
      Ptr_Comp:          536870792
            should be:   (implementation-dependent), same as above
      Discr:             0
            should be:   0
      Enum_Comp:         1
            should be:   1
      Int_Comp:          18
            should be:   18
      Str_Comp:          DHRYSTONE PROGRAM, SOME STRING
            should be:   DHRYSTONE PROGRAM, SOME STRING
    Int_1_Loc:           5
            should be:   5
    Int_2_Loc:           13
            should be:   13
    Int_3_Loc:           7
            should be:   7
    Enum_Loc:            1
            should be:   1
    Str_1_Loc:           DHRYSTONE PROGRAM, 1'ST STRING
            should be:   DHRYSTONE PROGRAM, 1'ST STRING
    Str_2_Loc:           DHRYSTONE PROGRAM, 2'ND STRING
            should be:   DHRYSTONE PROGRAM, 2'ND STRING
    Time = 74000 us
    Microseconds for one run through Dhrystone: 3.70
    Dhrystones per Second:                      270270
    ----------- COREMARK -------------
    2K performance run parameters for coremark.
    CoreMark Size    : 666
    Total ticks      : 45291107
    Total time (secs): 45.291107
    Iterations/Sec   : 220.793897
    Iterations       : 10000
    Compiler version : GCC4.8.4 20140725 (release) [ARM/embedded-4_8-branch revision 213147]
    Compiler flags   :  -O3 -Otime
    Memory location  : IRAM
    seedcrc          : 0xe9f5
    [0]crclist       : 0xe714
    [0]crcmatrix     : 0x1fd7
    [0]crcstate      : 0x8e3a
    [0]crcfinal      : 0x988c
    Correct operation validated. See readme.txt for run and reporting rules.
    CoreMark 1.0 : 220.793897 / GCC4.8.4 20140725 (release) [ARM/embedded-4_8-branch revision 213147]  -O3 -Otime / IRAM
    END.
    


    Output to the terminal the results of a test running in Visual Studio 2015
    ----------- Speed Test -------------
    Reference time = 100000 us
    ----------- umm malloc test -------------
    ...........................................................
    |0x00ba5980|B     0|NB     1|PB     0|Z     1|NF     1|PF     0|USED
    |0x00ba5988|B     1|NB  4223|PB     0|Z  4222|NF  4223|PF     0|FREE
    |0x00badd78|B  4223|NB     0|PB     1|Z     1|NF     0|PF     1|USED
    ...........................................................
    Total Entries     1    Used Entries      0    Free Entries      1
    Total Blocks   4223    Used Blocks       0    Free Blocks    4223
                           Used space =      0    Free space =  33784
    ...........................................................
    umm malloc test   time  = 13586 uS
    Allocations =  40000, uSec per allocation = 0
    ----------- Compressor LZSS test -------------
    Uncompressed size = 2048
    Compressed   size = 1858. Max. alloc.= 14384. Time = 146 uS
    Decompress                Max. alloc.= 1048. Time = 10 uS
    Decompress Ok!
    ----------- Compressor Zlib test -------------
    Uncompressed size = 2048
    Compressed   size = 1740. Max. alloc.= 24288. Time = 241 uS
    Decompress                Max. alloc.= 15768. Time = 20 uS
    Decompress Ok!
    ----------- Compressor S-LZW test -------------
    Uncompressed size = 2048
    Compressed   size = 2035. Max. alloc.= 4320. Time = 47 uS
    Decompress                Max. alloc.= 4320. Time = 31 uS
    Decompress Ok!
    ----------- Compressor FastLZ test -------------
    Uncompressed size = 2048
    Compressed   size = 1834. Max. alloc.= 32776. Time = 13 uS
    Decompress                Max. alloc.= 0. Time = 4 uS
    Decompress Ok!
    ----------- WHETSTONE FLOAT -------------
    .........MODULE 1:  simple identifiers...
      xx1  = -0.06679254770278930700
      xx2  = -0.46633863449096680000
      xx3  = -0.73303699493408203000
      xx4  = -1.13254797458648680000
    .........MODULE 2:  array elements.......
      e10  = -0.06834230571985244800
      e11  = -0.46263590455055237000
      e12  = -0.72971796989440918000
      e13  = -1.12397670745849610000
    .........MODULE 3:  array as parameter...
      e1_0 = -0.05533060804009437600
      e1_1 = -0.44743216037750244000
      e1_2 = -0.71096724271774292000
      e1_3 = -1.10309338569641110000
    .........MODULE 4:  conditional jumps....
      val  = 1
    .........MODULE 6:  integer arithmetic...
      e1k  = 6.00000000000000000000
      e1l  = 6.00000000000000000000
    .........MODULE 7:  trig. functions......
      x1   = 0.49040612578392029000
      y1   = 0.49039128422737122000
    .........MODULE 8:  procedure calls......
      z    = 0.99993747472763062000
    .........MODULE9:  array references......
      e1_j = -1.10309338569641110000
      e1_k = 3.00000000000000000000
      e1_l = -1.10309338569641110000
    .........MODULE10:  integer arithmetic...
      j    = 2
      k    = 3
    .........MODULE11:  standard functions...
      x    = 0.83466225862503052000
    ........................................
    Whetstone last    time (uS) = 00131.00
    Whetstone max     time (uS) = 00168.00
    Whetstone min     time (uS) = 00123.00
    ----------- WHETSTONE DOUBLE -------------
    .........MODULE 1:  simple identifiers...
      xx1  = -0.06679268039452399000
      xx2  = -0.46633881454398041000
      xx3  = -0.73303694842681344000
      xx4  = -1.13254799829068810000
    .........MODULE 2:  array elements.......
      e10  = -0.06834219862995163900
      e11  = -0.46263765626356895000
      e12  = -0.72971838784369047000
      e13  = -1.12397907004612830000
    .........MODULE 3:  array as parameter...
      e1_0 = -0.05533645259179446200
      e1_1 = -0.44743656275474680000
      e1_2 = -0.71097338928518250000
      e1_3 = -1.10309805692560080000
    .........MODULE 4:  conditional jumps....
      val  = 1
    .........MODULE 6:  integer arithmetic...
      e1k  = 6.00000000000000000000
      e1l  = 6.00000000000000000000
    .........MODULE 7:  trig. functions......
      x1   = 0.49040731615904543000
      y1   = 0.49039249795610007000
    .........MODULE 8:  procedure calls......
      z    = 0.99993750062499998000
    .........MODULE9:  array references......
      e1_j = -1.10309805692560080000
      e1_k = 3.00000000000000000000
      e1_l = -1.10309805692560080000
    .........MODULE10:  integer arithmetic...
      j    = 2
      k    = 3
    .........MODULE11:  standard functions...
      x    = 0.83466551951905787000
    ........................................
    Whetstone last    time (uS) = 00152.00
    Whetstone max     time (uS) = 00186.00
    Whetstone min     time (uS) = 00142.00
    ----------- DHRYSTONE 2 -------------
    Dhrystone Benchmark, Version 2.1 (Language: C)
    Program compiled without 'register' attribute
    Execution starts, 20000 runs through Dhrystone
    Execution ends
    Final values of the variables used in the benchmark:
    Int_Glob:            5
            should be:   5
    Bool_Glob:           1
            should be:   1
    Ch_1_Glob:           A
            should be:   A
    Ch_2_Glob:           B
            should be:   B
    Arr_1_Glob[8]:       7
            should be:   7
    Arr_2_Glob[8][7]:    20010
            should be:   Number_Of_Runs + 10
    Ptr_Glob->
      Ptr_Comp:          3602560
            should be:   (implementation-dependent)
      Discr:             0
            should be:   0
      Enum_Comp:         2
            should be:   2
      Int_Comp:          17
            should be:   17
      Str_Comp:          DHRYSTONE PROGRAM, SOME STRING
            should be:   DHRYSTONE PROGRAM, SOME STRING
    Next_Ptr_Glob->
      Ptr_Comp:          3602560
            should be:   (implementation-dependent), same as above
      Discr:             0
            should be:   0
      Enum_Comp:         1
            should be:   1
      Int_Comp:          18
            should be:   18
      Str_Comp:          DHRYSTONE PROGRAM, SOME STRING
            should be:   DHRYSTONE PROGRAM, SOME STRING
    Int_1_Loc:           5
            should be:   5
    Int_2_Loc:           13
            should be:   13
    Int_3_Loc:           7
            should be:   7
    Enum_Loc:            1
            should be:   1
    Str_1_Loc:           DHRYSTONE PROGRAM, 1'ST STRING
            should be:   DHRYSTONE PROGRAM, 1'ST STRING
    Str_2_Loc:           DHRYSTONE PROGRAM, 2'ND STRING
            should be:   DHRYSTONE PROGRAM, 2'ND STRING
    Time = 551 us
    Microseconds for one run through Dhrystone: 0.03
    Dhrystones per Second:                      36297640
    ----------- COREMARK -------------
    2K performance run parameters for coremark.
    CoreMark Size    : 666
    Total ticks      : 11012043
    Total time (secs): 11.012043
    Iterations/Sec   : 9080.967083
    Iterations       : 100000
    Compiler version : VS 2013
    Compiler flags   :  -O3 -Otime
    Memory location  : IRAM
    seedcrc          : 0xe9f5
    [0]crclist       : 0xe714
    [0]crcmatrix     : 0x1fd7
    [0]crcstate      : 0x8e3a
    [0]crcfinal      : 0xd340
    Correct operation validated. See readme.txt for run and reporting rules.
    CoreMark 1.0 : 9080.967083 / VS 2015  -O3 -Otime / IRAM
    END.
    



    How did the Intel Core i7


    The fact is that all compression algorithms and the memory manager were debugged in the Visual Studio environment and this is the processor of my computer. The archive contains the SpeedTest_VS directory, which contains the project for Visual Studio 2015 and in which you can continue to improve these algorithms if you wish.

    Conclusion


    IAR was the undisputed leader in the ranking. The most surprising thing is that while maintaining the effectiveness of IAR code, it is also a leader in compilation speed. The fly in the ointment unaccounted for here is that the IAR comes with quite a bit of a functional source editor. You can, of course, start compiling IAR tools directly from the KDS environment , since KDS is the same slightly modified Eclipse version of Mylyn . But the recompilation time then increases to 2 minutes! Have eclipsethere is also a drawback, it slowly opens, with a certain size of the source, contextual parsing starts to slow down. There is a SpeedTest_SE directory in the project of this test . It contains the file SpeedTest.vpw of the project workspace of this test for the SlickEdit editor . SlickEdit is a great, very fast editor, and the IAR IDE can automatically track file changes, so there is no problem sharing them.

    The full project archive (97.7 MB) is available at https://drive.google.com/file/d/0B5dbvc_yPqJHYWI0OE9YZklKRjQ/view?usp=sharing

    Also popular now: