[E3-hacking] Compiling Apps

Jasmine Strong jasmine at electronpusher.org
Wed Oct 4 00:58:43 BST 2006

(performance engineer hat engaged)

On 4 Oct 2006, at 01:30, David Given wrote:

> Incidentally, I also have an NSLU2, which is a similar specced ARM  
> device with
> 32MB and a USB 2 disk. Trying to compile C++ on that more or less  
> kills it
> stone dead. Trying to compile a 4000 line C++ program took,  
> basically, all
> day; I think this is because the C++ compiler's working set is too  
> big to fit
> in RAM, which means its thrashing the swap continuously. So given  
> that the E3
> has a USB 1 connection, making for ludicrously slow swap, things  
> would be even
> worse on it.

Were you running gcc from flash, or from disc?  If it's running from  
flash, I would
expect that to be faster than (at least USB1) disc.  Since program  
text pages
do not change appreciably during the run, they do not need to be  
copied into
writable swap, and so the rapid access of Flash can be a big boost when
you're short on RAM pages.  (Linux will discard pages of program without
saving them into swap, so you effectively get a free page of swap for  
text page).

Compiling with -O3 -fomit-stack-frame also helps ARM a lot more than  
you might expect,
since the optimizer can make serious gains there-  might want to  
check which
flags your gcc was built with.


More information about the e3-hacking mailing list