bin/166241: Speedup and some improvements of sysinstall
SAKAI Hiroaki
kozos at kozos.jp
Mon Mar 19 09:40:13 UTC 2012
>Number: 166241
>Category: bin
>Synopsis: Speedup and some improvements of sysinstall
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Mon Mar 19 09:40:12 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator: SAKAI Hiroaki
>Release: FreeBSD 8.2
>Organization:
KOZOS Project
>Environment:
FreeBSD hotroom.mydomain.net 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Fri Feb 18 02:24:46 UTC 2011 root at almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386
>Description:
These are improvements for FreeBSD installer 'sysinstall'.
***PROBLEMS***
'sysinstall' has some problems as below:
* Startup of package installer takes very long time
because of bubble sort for making index.
(Phase: "Located INDEX, now reading package data from it...")
* On www category of package installer, package view is broken.
* URL for FTP is not saved.
***MODIFY***
I made patches for sysinstall to improve these problems.
* Speedup to start package installer. (127sec. -> 15sec.)
- Startup of package installer consists of 3 phases.
1st. Making package list.
2nd. Check dependence between packages.
3rd. Sort of package list.
- Improvement for 1st phase:
To search category, move entry to start of list
for improvement of chance to hit.
(patch to index_register())
- Improvement for 2nd phase:
To check dependence between packages, move entry to start of list
for improvement of chance to hit.
(patch to index_search() and index_recorddeps())
- Improvement for 3rd phase:
Use quick sort instead of bubble sort. (very effective!)
(patch to index_sort())
* Improvement for package view of www category.
- Check string size and prevent buffer overrun.
(patch to index_menu())
* Prevent segmentation fault by access to NULL pointer.
- Add check 'mediaDevice'.
(patch to index_extract())
* Save URL for FTP.
- patch to mediaSetFTP().
***PATCHES***
You can get these patches from:
http://kozos.jp/patch/sysinstall/index.c.patch.txt
http://kozos.jp/patch/sysinstall/media.c.patch.txt
Patching as below:
# cd /usr/src/usr.sbin/sysinstall
# patch < /tmp/index.c.patch.txt
# patch < /tmp/media.c.patch.txt
# make
These patches are for FreeBSD-8.2. But, source files for sysinstall
are mostly same between FreeBSD-8.2 and FreeBSD-9.0.
Because of this, you can use these patches for FreeBSD-9.0.
***RESULTS***
Improvement results on my environment:
Startup Time
Improvement 1st+2nd 3rd All
-----------------------------------------------
original 40sec. 87sec. 127sec.
3rd 40sec. 0sec. 40sec. (very effective!)
1st+3rd 20sec. 0sec. 20sec.
1st+2nd+3rd 15sec. 0sec. 15sec.
--
from kozos project.
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list