Registering of ports when doing "make install", for ports that have many dependencies (e.g. x11/gnome2), or making packages using "make package", takes a very long time. A significant part of the problem is in the function sortdeps in deps.c, which uses a rather inefficient bubble sort.
Responsible Changed From-To: freebsd-ports-bugs->portmgr Move over to bin, assign to portmgr
Tested the patch, appears to "work" for me.
I am using the patch since Stephen first posted it on the mailing list: http://lists.freebsd.org/pipermail/freebsd-ports/2007-May/040794.html It did not cause any trouble so far and the speed improvement is extremely significant. Together with Stephens other patch that has just been commited: http://www.freebsd.org/cgi/query-pr.cgi?pr=112765 the registration time of x11/xorg went down from ~15 minutes to 18 seconds on one of my systems.
State Changed From-To: open->analyzed This patch is currently being tested in exprun
State Changed From-To: analyzed->patched Committed to HEAD; pending MFC
pav 2007-06-18 22:49:13 UTC FreeBSD src repository (doc,ports committer) Modified files: usr.sbin/pkg_install/lib deps.c Log: - Replace rather inefficient bubble sort with a recursive depth-first search. This speeds up registration of packages considerably. - style(9) police welcome! PR: bin/112630 Submitted by: Stephen Montgomery-Smith <stephen@cauchy.math.missouri.edu> Tested by: bento i386 experimental run MFC after: 14 days Revision Changes Path 1.12 +111 -65 src/usr.sbin/pkg_install/lib/deps.c _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
State Changed From-To: patched->closed This was MFC'ed to 6-STABLE some time ago.
Hi! Thanks for the patch! However, it contains a some of style(9) bugs: + nrpkgs = 0; + while (pkgs[nrpkgs]) nrpkgs++; Should looks like: + while (pkgs[nrpkgs]) + nrpkgs++; + listed = alloca(nrpkgs); + if (listed == NULL) { + warnx("%s(): alloca() failed", __func__); + return 1; + } + bzero(listed,nrpkgs); missing spaces + check_loop = alloca(nrpkgs); + if (check_loop == NULL) { + warnx("%s(): alloca() failed", __func__); + return 1; + } + bzero(check_loop,nrpkgs); missing spaces + newpkgs = alloca(nrpkgs*sizeof(char*)); the same + if (newpkgs == NULL) { + warnx("%s(): alloca() failed", __func__); + return 1; + } + nrnewpkgs = 0; + + for (i = 0; pkgs[i]; i++) if (!listed[i]) { missing newline & indentation. Also non style(9) check (should be listed[i] != 0). } + for (i = 0; i < nrnewpkgs; i++) pkgs[i] = newpkgs[i]; + missing newline. + list_deps(pkgs [j],pkgs,listed,check_loop,newpkgs,nrnewpkgs,err_cnt); + listed[j] = 1; + newpkgs[*nrnewpkgs] = pkgs[j]; + (*nrnewpkgs)++; + } spaces. Again, thanks for your work!