Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Jul 2003 08:49:15 +0100
From:      Mark Murray <mark@grondar.org>
To:        "Poul-Henning Kamp" <phk@phk.freebsd.dk>
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:  <200307230749.h6N7nFZ2071337@grimreaper.grondar.org>
In-Reply-To: Your message of "Wed, 23 Jul 2003 07:31:12 %2B0200." <19767.1058938272@critter.freebsd.dk> 

next in thread | previous in thread | raw e-mail | index | archive | help
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.

> 			commit it;
> 			return;
> 		} 
> 		run benchmark;
> [3]		if (code runs faster) {
> 			/* inline is beneficial */
> 			commit it;
> 			return;
> 		}
> 	}
> 	/* inline not proven beneficial */
> 	return;
--
Mark Murray
iumop ap!sdn w,I idlaH



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