[En-Nut-Discussion] Nut/OS Code Size (was AT91 EMAC Fix in Rev-2561)

Thiago A. Corrêa thiago.correa at gmail.com
Sun Mar 29 15:20:07 CEST 2009


Hi,

On Sat, Mar 28, 2009 at 5:20 AM, Harald Kipp <harald.kipp at egnite.de> wrote:
> Please take a look at Ernst Stippl's statistics at
> http://www.es-business.com/ethernut/eng/vers_avr.php
>
> These are the .text segment sizes of app/httpd, all using the same
> compiler (AVR-GCC 3.4.5):
>
> 4.0.2 0x013338
> 4.1.5 0x0134e4
> 4.2.1 0x013c22
> 4.4.0 0x013c62
> 4.5.4 0x015804
> 4.7.4 0x015f48
>
> >From version 4.0.2 the code size had grown by 11280 bytes, when using
> GCC 4.3.0 and a later avr-libc, the increase is even 12630 bytes!!!
>
> This is a bad development and must be stopped.
>

I'm also worried about the code size increases.
But from my experiense, it seems that the compiler have had a bigger
impact than ethernut version changes. I have some code that upgrading
the compilers makes it 6Kb larger.

It looks like gcc for avr targets gets worst at generating small code
with each release.

We could try to do some size optimization, but I'm not aware if there
is any "good technique" for that other than standard good practices
such as avoiding duplicate code and such.

avr-nm -S --sortsize on my largest product firmware gives me those as
worst functions:
00012f70 00000318 T GpioPinConfigSet
00016f26 00000346 t cvtdate
0000f43e 0000034a T NutHttpProcessAsp
00001ef4 0000034c T ProcessRequests
00017c82 00000360 T localtime_r
00004154 00000372 t IOServices                               <-- mine
(this is the one that uses boost::preprocessor btw)
000006e4 000003b2 T file1data
0000926a 000003c6 T NutTcpOutput
00016a6e 000003c6 t _make_time_t
00000edb 00000419 T file3data
00000aa0 00000431 T file2data
00015154 0000049e t TermPut
00005952 00000580 T ConfigService                          <-- mine
000012ff 0000058f T file4data
000044c6 000005bc t Terminal                                  <-- mine
00017534 0000069e T _putf
0000e736 000006ca T NutHttpProcessRequest
0000d5fc 000006fa T NutDnsGetResource
00004a82 0000095e t SerialSettings                           <--- mine
00009dd8 000009b4 T NutTcpSm
000027b2 000009ce T handleTerminalCommand          <--- mine
0000c540 00000eee T NutDhcpClient
0000648c 00000fba T DisplayService                          <--- mine

Kind Regards,
   Thiago A. Correa



More information about the En-Nut-Discussion mailing list