Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Jul 2003 09:53:57 +0200
From:      "Poul-Henning Kamp" <phk@phk.freebsd.dk>
To:        Mark Murray <mark@grondar.org>
Cc:        cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/kern init_main.c kern_malloc.c md5c.c subr_autoconf.c subr_mbuf.c subr_prf.c tty_subr.c vfs_cluster.c vfs_subr.c 
Message-ID:  <20846.1058946837@critter.freebsd.dk>
In-Reply-To: Your message of "Wed, 23 Jul 2003 08:49:15 BST." <200307230749.h6N7nFZ2071337@grimreaper.grondar.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <200307230749.h6N7nFZ2071337@grimreaper.grondar.org>, Mark Murray wr
ites:
>Hi
>
>There is a problem with your algorithm.
>
>M
>
>"Poul-Henning Kamp" writes:
>> The algorithm I would like to see implemented as a pre-commit check
>> for the __inline* keywords are:
>> 
>> 
>> [1]	if (programmer thinks inline might be useful) {
>> 		try compiling with inline;
>> [2]		if (object code smaller) {
>> 			/* inline is beneficial */
>
>The executable could be too slow here. This forces "small code"
>to be always better, at the potential expense of speed.

Fine fine fine!  It was meant to make it easier for people to justify
inlines, but if you don't like it we'll stick with only the hard
way:

	Nothing should be inlined unless it has a demonstrated,
	measurable positive effect.

Or put even more bluntly:

	Don't add inlines you haven't benchmarked.

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20846.1058946837>