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

Poul-Henning Kamp phk at phk.freebsd.dk
Wed Jul 23 00:54:02 PDT 2003


In message <200307230749.h6N7nFZ2071337 at 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 at 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.


More information about the cvs-all mailing list