From owner-freebsd-small Fri Jun 30 2: 5:10 2000 Delivered-To: freebsd-small@freebsd.org Received: from mailrouter1.strath.ac.uk (orkney.cc.strath.ac.uk [130.159.248.40]) by hub.freebsd.org (Postfix) with ESMTP id 6097037C3A9 for ; Fri, 30 Jun 2000 02:05:04 -0700 (PDT) (envelope-from roger@cs.strath.ac.uk) Received: from [62.252.148.118] (helo=cs.strath.ac.uk) by mailrouter1.strath.ac.uk with esmtp (Exim 3.12 #2) id 137wio-000633-00 for small@freebsd.org; Fri, 30 Jun 2000 10:04:27 +0100 Message-ID: <395C62D9.4E9C8DA@cs.strath.ac.uk> Date: Fri, 30 Jun 2000 10:05:29 +0100 From: Roger Hardiman Organization: Strathclyde University X-Mailer: Mozilla 4.51 [en] (X11; I; FreeBSD 4.0-STABLE i386) X-Accept-Language: en MIME-Version: 1.0 To: small@freebsd.org Subject: more on optimimise for size (was space) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-small@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi, Here are some results for building 'bridge' on 4.0-stable with -Os (optimize for size) passed to gcc instead of -O. Results looked good, but gzip let me down. 1) CHANGE THE OPTIMISATION FLAGS FOR GCC I built the kernel 4 times, with different optimisation settings. default optimise: gcc -O kernel is 1212593 bytes. better optimise: gcc -02 kernel is 1211345 bytes best optimise: gcc -O3 kernel is 1257613 bytes size optimise: gcc -Os kernel is 1203761 bytes GOOD NEWS FOR THE KERNEL Yippee. comparing 'size' to 'default' optimisation, we SAVE 8832 bytes, or 8K 2) COMPRESSING KERNEL WITH GZIP Then I gzipped the kernel files using gzip. default optimise: kernel.gz is 551628 bytes better optimise: kernel.gz is 559805 bytes. best optimise: kernel.gz is 576482 bytes. size optimise: kernel.gz is 554033 bytes. BAD NEWS FOR GZIP comparing 'size' to 'default' This is a 2.4k INCREASE. SUMMARY Optimise for size will make the kernel image 8k smaller but it will not make it fit on the floppy any better. Any comments on this? Platform FreeBSD 4.0-stable kernel (updated source yesterday) Bridge kernel but with some local modifications. (take out dummynet and ipfw, add new network card drivers) Roger -- Roger Hardiman Strathclyde Uni Telepresence Research Group, Glasgow, Scotland. http://www.telepresence.strath.ac.uk 0141 548 2897 roger@cs.strath.ac.uk To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-small" in the body of the message