This is the mail archive of the
mailing list for the newlib project.
Re: [PATCH 2/2] getopt.c: use fputs()/fputc() instead of fprintf() to, save code space
- From: Freddie Chopin <freddie_chopin at op dot pl>
- To: newlib at sourceware dot org
- Date: Sat, 09 Nov 2013 08:55:58 +0100
- Subject: Re: [PATCH 2/2] getopt.c: use fputs()/fputc() instead of fprintf() to, save code space
- Authentication-results: sourceware.org; auth=none
- References: <527D3E68 dot 1020600 at op dot pl> <527DAAD4 dot 1090201 at LGSInnovations dot com>
W dniu 2013-11-09 04:24, Craig Howland pisze:
I am curious: what were your the overall savings?
In case of my current project, which does use some formatted output, but
only with integer versions of printf(), the code with original getopt()
uses 151kB, while getopt() with fputs()/fputc() uses 134kB, so 17kB
less. I could also try to check how much is pulled into an empty project
when adding getopt(), so that would show the absolute size difference.
The change of RAM usage is really hard to measure, but if you'd really
like to know that, I could try to check that too. I suspect it would be
a couple hundred bytes of stack.