Subject: toolchain/15122: system make(1) performance Sucks
To: None <gnats-bugs@gnats.netbsd.org>
From: Paul Kranenburg <pk@cs.few.eur.nl>
List: netbsd-bugs
Date: 01/03/2002 11:26:24
>Number:         15122
>Category:       toolchain
>Synopsis:       system make(1) performance Sucks
>Confidential:   yes
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 03 02:27:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Paul Kranenburg
>Release:        NetBSD-current 1/3/2002
>Organization:
	
>Environment:
System: NetBSD hamfast 1.5ZA NetBSD 1.5ZA (HAMFAST)
Architecture: sparc
Machine: sparc
>Description:
	Recent changes to various system make header files in /usr/share/mk
	cause a remarkable slowdown of the make process in the system
	source hierarchy (actually in any source hierarchy using the
	features provided by /usr/share/mk/*.mk).
>How-To-Repeat:
	Here's an example of a straightforward make process in a
	straightforward subdirectory of the NetBSD source tree:
	`make obj' in .../src/usr.bin. Note: all object directories
	were in place already so no time is spent on I/O to create
	directories. All time is spent by make(1) figuring out what
	to do; I'll let the numbers speak for themselves:

	1. The source tree as of May 2002:
		% cd /usr/src/usr.bin
		% time make obj
		46.3u 19.4s 1:15.61 86.9% 0+0k 731+588io 0pf+0w

	2. Current source tree as of Jan 2, 2002:
		% cd /usr/src/usr.bin
		% time make obj
		278.5u 129.3s 6:41.47 101.6% 0+0k 668+1049io 0pf+0w


	Similar results can be seen with `make cleandir'.

	The following extremely simple test environment also clearly
	shows the point.
	####start####
	#!/bin/sh
	D="b c d e f g h i j k l m n o p q r s t u v w x y z"

	mkdir /tmp/T
	cd /tmp/T

	mkdir a
	for d in $D; do
		ln -s a $d
	done

	cat << EOF > Makefile
	.include <bsd.own.mk>

	SUBDIR=	a $D

	.include <bsd.subdir.mk>
	EOF

	cat << EOF > a/Makefile
	.include <bsd.prog.mk>
	EOF

	time make -m /old/version/of/share/mk obj
	time make -m /usr/src/share/mk obj
	####end####
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: