From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KLQH9-0005Ky-Ep for mharc-grub-devel@gnu.org; Tue, 22 Jul 2008 18:24:07 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KLQH7-0005KI-Qw for grub-devel@gnu.org; Tue, 22 Jul 2008 18:24:05 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KLQH7-0005Jx-7e for grub-devel@gnu.org; Tue, 22 Jul 2008 18:24:05 -0400 Received: from [199.232.76.173] (port=38896 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KLQH6-0005Jq-Uf for grub-devel@gnu.org; Tue, 22 Jul 2008 18:24:05 -0400 Received: from aybabtu.com ([69.60.117.155]:33492) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KLQH6-00065h-RH for grub-devel@gnu.org; Tue, 22 Jul 2008 18:24:05 -0400 Received: from [192.168.10.10] (helo=thorin) by aybabtu.com with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1KLQBD-0003Jb-7M for grub-devel@gnu.org; Wed, 23 Jul 2008 00:17:59 +0200 Received: from rmh by thorin with local (Exim 4.63) (envelope-from ) id 1KLQGF-0004RK-IN for grub-devel@gnu.org; Wed, 23 Jul 2008 00:23:11 +0200 Date: Wed, 23 Jul 2008 00:23:11 +0200 From: Robert Millan To: grub-devel@gnu.org Message-ID: <20080722222311.GA16860@thorin> References: <20080704135501.GA2612@thorin> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20080704135501.GA2612@thorin> Organization: free as in freedom X-Message-Flag: Worried about Outlook viruses? Switch to Thunderbird! www.mozilla.com/thunderbird X-Debbugs-No-Ack: true User-Agent: Mutt/1.5.13 (2006-08-11) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: [PATCH] avoid expensive load of all fonts X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2008 22:24:06 -0000 Committed. On Fri, Jul 04, 2008 at 03:55:01PM +0200, Robert Millan wrote: > > This makes update-grub avoid expensive load of complete font files > and instead rely on ascii.pff when it is available. In qemu, it brings > startup time roughly from 25s to 1s. > > -- > Robert Millan > > I know my rights; I want my phone call! > What good is a phone call… if you are unable to speak? > (as seen on /.) > 2008-07-04 Robert Millan > > * Makefile.in (UNICODE_ARROWS, UNICODE_LINES): New variables (they > define the codes for arrows and lines used for the menu). > (ascii.pff): Generate fonts for $(UNICODE_ARROWS) and $(UNICODE_LINES) > as well. > > * util/update-grub_lib.in (font_path): Prefer ascii.pff over complete > fonts, because the latter are too slow. > > Index: Makefile.in > =================================================================== > --- Makefile.in (revision 1691) > +++ Makefile.in (working copy) > @@ -142,11 +142,16 @@ > ifeq (, $(UNIFONT_HEX)) > else > pkgdata_DATA += unicode.pff ascii.pff > + > +# Arrows and lines are needed to draw the menu, so we always include them > +UNICODE_ARROWS=0x2190-0x2193 > +UNICODE_LINES=0x2501-0x251B > + > unicode.pff: $(UNIFONT_HEX) > ruby $(srcdir)/util/unifont2pff.rb $(UNIFONT_HEX) > $@ > > ascii.pff: $(UNIFONT_HEX) > - ruby $(srcdir)/util/unifont2pff.rb 0-127 $(UNIFONT_HEX) > $@ > + ruby $(srcdir)/util/unifont2pff.rb 0x0-0x7f $(UNICODE_ARROWS) $(UNICODE_LINES) $(UNIFONT_HEX) > $@ > endif > > all-local: $(PROGRAMS) $(PKGLIB) $(PKGDATA) $(SCRIPTS) $(MKFILES) > Index: util/update-grub_lib.in > =================================================================== > --- util/update-grub_lib.in (revision 1691) > +++ util/update-grub_lib.in (working copy) > @@ -131,8 +131,9 @@ > font_path () > { > for dir in ${pkgdatadir} /boot/grub /usr/share/grub ; do > - # Prefer complete fonts over incomplete ones. > - for basename in unicode unifont ascii ; do > + # FIXME: We prefer ascii because loading complete fonts is too slow (and > + # we don't yet provide the gettext magic that would make unicode useful). > + for basename in ascii unicode unifont ; do > path="${dir}/${basename}.pff" > if is_path_readable_by_grub ${path} > /dev/null ; then > echo "${path}" > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel -- Robert Millan I know my rights; I want my phone call! What good is a phone call… if you are unable to speak? (as seen on /.)