Re: [iPAQ] Compiling Programs

From: Warwick Allison <warwick.a.t.trolltech.com>
Date: Wed Jun 13 2001 - 00:45:05 EDT

On Tuesday 12 June 2001 9:29am, Edward Muller wrote:
> Sorry for the cross list posting....But I think this is important enough...
>
> I want to ask people compiling programs for the iPAQ to compile them with
> the -Os optimization instead of the -O2 optimization. According to the gcc
> man pages/information that I've read -Os is like -O2, but with additional
> optimizations for size (not RAM, but file).
>
> In the programs I've compiled for the iPAQ I've seen anywhere from 10% to
> 20% size reductions (usually around 10%, but 10% across 16 MB is 1.6 MB ...
> :-)

I expect it vastly depends on the code you're compiling. As another
datapoint, the 30 QPe applications total 992K (2500K uncompressed) of Flash
usage when compiled with -O2, and 980K (2484K uncompressed) when compiled
with -Os, which is a saving of a mere 12K, 1.2%, of flash - comparable to
Erik Mouw's results with the kernel. This is with gcc 2.95.2.

The Word Game (the only really CPU-intensive QPe application) is noticeably
slower with -Os than -O2.

Note that GCC doesn't unroll loops with -O2.

--
Warwick
ps. QPe is http://qpe.sourceforge.net if you're wondering.
Received on Tue Jun 12 21:42:23 2001

This archive was generated by hypermail 2.1.8 : Tue May 04 2004 - 09:44:01 EDT