[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#492086: partman: menus are very slow

Subject: partman: menus are very slow
Package: debian-installer
Severity: wishlist

*** Please type your report below this line ***
The menus used by the partition manager during an install in low-memory mode
are very slow.  Several seconds elapse between <Enter> and the next menu.  This
is too long.  The delay should be 1/2 second or less, similar to the reponse
for choosing timezone (continent, country, zone) at the beginning of install.

Examining /lib/partman/lib/base.sh, the culprit is the intensive use of
constructs such as  "$(cat $dir/default_response)".  This takes way too long.

First, avoid searching for "cat" every time.  The default search tries:
before finding /bin/cat.  Instead: use 'which' or 'type' to do the search once,
assign the result to a local variable, and expand the variable instead of
   CAT=$(which cat)
   $($CAT $dir/default_response)
Or, in nearly all cases the result is known ahead of time:

Second, use a shell builtin if possible:
   $(< $dir/default_response)
which is documented and works in bash.  The current version 0.5.4-11
of 'ash' does not complain, but also does not give the correct result.

Third, use shell text strings where possible:
   PM':'$dir':'default_response=$( ... )   # capture value as text
   $PM':'$dir':'default_response   # expand text variable
This is a good candidate for the fastest possible method, although it looks

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: armel (armv5tel)

Kernel: Linux 2.6.25-2-ixp4xx
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash


Reply to: