Bug#477083: grub-pc: Is excruciatingly slow when compared to grub (legacy)

Robert Millan rmh at aybabtu.com
Thu Apr 24 07:28:11 UTC 2008


On Sun, Apr 20, 2008 at 10:35:35PM +0200, Frans Pop wrote:
> 
> I have tried grub-pc a few times during my installation tests and
> noticed that it is really significantly slower than grub "legacy".
> This may or may not be very visible on real hardware, but in Virtualbox
> (running on a fast, modern host system) the difference is 30 seconds.
> 
> With grub I am looking at the grub menu 4 seconds after I start the
> virtual machine (which includes ~2 seconds of allowing to select a
> different boot medium by the VM's "bios").
> With grub-pc this is 34 (!) seconds.
> 
> You can clearly see the different stages too, even of the menu being
> built up (numbers are seconds:
>  0- 3: start virtual machine and BIOS stuff
>  3   : "Welcome to GRUB!" is displayed
>  3-28: occasional disk activity, but display remains the same
> 28   : "GNU GRUB  version 1.96" is displayed
> 30-32: slooowly the border is built up from top to bottom and the help
>        text below is displayed
> 32-33: no visible action
> 33-34: menu items are shown and the blue background is filled in

That's strange.  In my laptop it just takes ~2 seconds from MBR load up
untill menu is displayed.

What are the constraints in your test environment?  I assume CPU will be
ultra-slow but disk access (through BIOS) relatively fast?

> Note that there's also #476479 ("takes 10 seconds to get to the menu")
> which is currently assigned to grub-common. I'm willing to bet that report
> is about grub-pc too, and not about grub "legacy".

Now that I check, the "Welcome to GRUB!" string is actually GRUB2-specific.
I'm reassigning that one...

> Also, scrolling through the menu is quite slow and there's "flashing" of
> the (previously highlighted) menu item line while scrolling. This is
> different from the flashing mentioned in #437275.

Ah, I see what you mean.  It's erasing the whole line and then drawing it
again, right?

> With grub "legacy", the menu appears almost instantaneously and the
> scrolling is fast and smooth.

Well, notice there's a handicap of sorts.  The code for drawing in text mode
is a BIOS callback and hasn't changed much (you can try it by setting
GRUB_TERMINAL=console in /etc/default/grub and re-run update-grub), but
the gfxterm/vbe stack is (forcibly) more expensive.  There's probably room
for optimization though.

-- 
Robert Millan

"The technological evasion of the license is as unacceptable as the
 legal evasion of the license [...].  That's the provision in section
 1 regarding keys. [...]  We say one thing: when you sell somebody a
 home... give him the keys"  -- Eben Moglen on GPLv3





More information about the Pkg-grub-devel mailing list