From: John Carter Date: 2008-01-16T13:28:31+09:00 Subject: Re: any tricks to speed up ruby? -fwhole-program? It's an old trick, I believe the kde folks do it (I may be wrong) Instead of creating lots and lots of .o's and linking them... Pull all the .c files into one stonking great .c file and compile that with... `-fwhole-program' Assume that the current compilation unit represents whole program being compiled. All public functions and variables with the exception of `main' and those merged by attribute `externally_visible' become static functions and in a affect gets more aggressively optimized by interprocedural optimizers. While this option is equivalent to proper use of `static' keyword for programs consisting of single file, in combination with option `--combine' this flag can be used to compile most of smaller scale C programs since the functions and variables become local for the whole combined compilation unit, not for the single source file itself. Takes forever and needs a huge amount of RAM, but it gives the optimizer more freedom. I wonder how hard it would be to tweak the ruby Makefile into doing that? John Carter Phone : (64)(3) 358 6639 Tait Electronics Fax : (64)(3) 359 4632 PO Box 1645 Christchurch Email : john.carter@tait.co.nz New Zealand