Difference between revisions of "Stm8 code size"

From SDCC wiki
Jump to: navigation, search
(Created page with "A history of code size in sdcc and a comparison to other compilers. == STM8 code size comparison (bytes): == {| border=1 class="simple" ! File ! Cosmic C² stm8 ! sdcc #xxx...")
 
m
 
(21 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
Note: There is [http://www.colecovision.eu/stm8/compilers.shtml another comparison of compilers targeting the STM8], that uses standard benchmarks and also considers other aspects, such as standard compliance and code speed.
 +
 
A history of code size in sdcc and a comparison to other compilers.
 
A history of code size in sdcc and a comparison to other compilers.
 +
 +
Note: these benchmarks are not representative. The files were originally chosen as examples of source for which SDCC generates particularly bad code compared to other compilers (that was quite a while ago, before SDCC even had a stm8 backend); the purpose of the table is mostly to see the progress of SDCC.
  
 
== STM8 code size comparison (bytes): ==
 
== STM8 code size comparison (bytes): ==
 +
 
{| border=1 class="simple"
 
{| border=1 class="simple"
 
! File  
 
! File  
! Cosmic C² stm8
+
! Cosmic
! sdcc #xxxx stm8
+
! IAR
 +
! sdcc 3.4.0³
 +
! sdcc 3.6.0³
 +
! sdcc 3.6.9 #10107³
 
|-  
 
|-  
 
|  cvu_vinb.c  
 
|  cvu_vinb.c  
7
+
'''6'''
x
+
'''6'''
 +
|  10
 +
|  10
 +
|  10
 
|-  
 
|-  
 
|  galois_lfsr.c  
 
|  galois_lfsr.c  
21
+
15
x
+
15
 +
|  '''12'''
 +
|  '''12'''
 +
|  '''12'''
 
|-  
 
|-  
 
|  get_tile.c  
 
|  get_tile.c  
95
+
89
x
+
87
 +
|  '''82'''
 +
|  '''82'''
 +
|  '''82'''
 
|-  
 
|-  
 
|  huffman_iterative.c  
 
|  huffman_iterative.c  
161
+
'''134'''
x
+
171
 +
|  162
 +
|  138
 +
|  142
 
|-  
 
|-  
 
|  huffman_recursive.c  
 
|  huffman_recursive.c  
198
+
'''140'''
x
+
168
 +
|  174
 +
|  178
 +
|  171
 
|-  
 
|-  
 
|  init_loop.c  
 
|  init_loop.c  
33
+
'''24'''
x
+
31
 +
|  27
 +
|  27
 +
|  27
 
|-  
 
|-  
 
|  insertion_sort.c  
 
|  insertion_sort.c  
108
+
'''92'''
x
+
111
 +
|  137
 +
|  126
 +
|  122
 
|-  
 
|-  
 
|  memcpy_compression.c  
 
|  memcpy_compression.c  
31
+
'''43'''
x
+
54
 +
|  56
 +
|  57
 +
|  57
 
|-  
 
|-  
 
|  memtovmemcpy.c  
 
|  memtovmemcpy.c  
30
+
'''44'''
x
+
55
 +
|  51
 +
|  50
 +
|  50
 
|-  
 
|-  
 
|  play_music.c  
 
|  play_music.c  
393
+
354
x
+
'''290'''
|-
+
352
sdcc_divulong.c
+
347
100
+
328
x
+
 
|-  
 
|-  
 
|  sdcc_mullong.c  
 
|  sdcc_mullong.c  
132
+
'''127'''
x
+
179
 +
|  352
 +
|  298
 +
|  287
 
|-  
 
|-  
 
|  set_screen_mode.c  
 
|  set_screen_mode.c  
|  49  
+
|  49
x
+
49
 +
|  61
 +
|  '''47'''
 +
|  '''47'''
 
|-  
 
|-  
 
|  set_sprite_x.c  
 
|  set_sprite_x.c  
66
+
'''55'''
x
+
65
 +
|  57
 +
|  63
 +
|  58
 
|-  
 
|-  
 
|  z88dk-mktime.c  
 
|  z88dk-mktime.c  
239
+
221
x
+
'''209'''
 +
|  347
 +
|  335
 +
|  317
 
|-  
 
|-  
 
|  total  
 
|  total  
x
+
'''1393'''
x
+
1490
 +
|  1880
 +
|  1770
 +
|  1710
 
|}
 
|}
  
Line 75: Line 124:
 
The benchmark files can be found at http://colecovision.eu/stuff/testbench.tar.gz
 
The benchmark files can be found at http://colecovision.eu/stuff/testbench.tar.gz
  
² C Compiler for STM8 (COSMIC Software); Generator V4.3.4 - 23 Mar 2010
+
All compilers have been configured for strong optimization for code size.
 +
 
 +
¹ C Compiler for STM8 (COSMIC Software); Generator V4.3.7; Optimizer V4.3.6. Current version as of mid-2013.
 +
 
 +
² IAR C/C++ Compiler V1.40.1.50106 for STM8. Current version as of mid-2013.
  
 +
³ Compiler options --opt-code-size --max-allocs-per-node 10000000
  
 
This is a list of feature requests, that combined will probably get code size down near to the level of the non-free compilers.
 
This is a list of feature requests, that combined will probably get code size down near to the level of the non-free compilers.

Latest revision as of 11:09, 25 October 2017

Note: There is another comparison of compilers targeting the STM8, that uses standard benchmarks and also considers other aspects, such as standard compliance and code speed.

A history of code size in sdcc and a comparison to other compilers.

Note: these benchmarks are not representative. The files were originally chosen as examples of source for which SDCC generates particularly bad code compared to other compilers (that was quite a while ago, before SDCC even had a stm8 backend); the purpose of the table is mostly to see the progress of SDCC.

[edit] STM8 code size comparison (bytes):

File Cosmic C¹ IAR C² sdcc 3.4.0³ sdcc 3.6.0³ sdcc 3.6.9 #10107³
cvu_vinb.c 6 6 10 10 10
galois_lfsr.c 15 15 12 12 12
get_tile.c 89 87 82 82 82
huffman_iterative.c 134 171 162 138 142
huffman_recursive.c 140 168 174 178 171
init_loop.c 24 31 27 27 27
insertion_sort.c 92 111 137 126 122
memcpy_compression.c 43 54 56 57 57
memtovmemcpy.c 44 55 51 50 50
play_music.c 354 290 352 347 328
sdcc_mullong.c 127 179 352 298 287
set_screen_mode.c 49 49 61 47 47
set_sprite_x.c 55 65 57 63 58
z88dk-mktime.c 221 209 347 335 317
total 1393 1490 1880 1770 1710


The benchmark files can be found at http://colecovision.eu/stuff/testbench.tar.gz

All compilers have been configured for strong optimization for code size.

¹ C Compiler for STM8 (COSMIC Software); Generator V4.3.7; Optimizer V4.3.6. Current version as of mid-2013.

² IAR C/C++ Compiler V1.40.1.50106 for STM8. Current version as of mid-2013.

³ Compiler options --opt-code-size --max-allocs-per-node 10000000

This is a list of feature requests, that combined will probably get code size down near to the level of the non-free compilers.

Request ID Summary
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox