I installed FreeBSD from bootonly cd and then I tried to install some packages by sysinstall from FTP mirror. It took about 6 minutes to read index on my computer (Pentium II 350Mhz, 128MB). There is about 15.000 packages and used sorting algorithm - bubble sort - is ineffective. See function index_sort in file usr.sbin/sysinstall/index.c. Fix: We should use some better sorting algorithm. My implementation of quick sort is attached to this problem report. Patch attached with submission follows:
Responsible Changed From-To: freebsd-bugs->re Dear Release engineers, I think this is something for you to have a look (or someone who dares touching sysinstall ;-))
Responsible Changed From-To: re->freebsd-bugs These days, we don't assign sysinstall PRs to re@.
Responsible Changed From-To: freebsd-bugs->freebsd-sysinstall Over to maintainer(s)
I don't think that this algorithm is correct, because instead of bisecting the set (like quicksort typically does), it's taking the first element, and then doing a bubble-like sort. Regardless of the correctness of the algorithm, if one is concerned about using quicksort, the replacement algorithm should be using qsort in libc (because it's more tested and most likely more correct). Thanks, -Garrett
sysinstall has been replaced by bsdinstall in FreeBSD 9.x. Closing.