From owner-freebsd-hackers Tue Oct 17 12:09:25 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id MAA04021 for hackers-outgoing; Tue, 17 Oct 1995 12:09:25 -0700 Received: from rocky.sri.MT.net (sri.MT.net [204.94.231.129]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id MAA04002 for ; Tue, 17 Oct 1995 12:09:18 -0700 Received: (from nate@localhost) by rocky.sri.MT.net (8.6.12/8.6.12) id NAA07670; Tue, 17 Oct 1995 13:10:37 -0600 Date: Tue, 17 Oct 1995 13:10:37 -0600 From: Nate Williams Message-Id: <199510171910.NAA07670@rocky.sri.MT.net> To: Terry Lambert Cc: bde@zeta.org.au (Bruce Evans), hackers@FreeBSD.ORG Subject: Optimizations matter? ( was Re: netisr code..) In-Reply-To: <199510171837.LAA28008@phaeton.artisoft.com> References: <199510170755.RAA00245@godzilla.zeta.org.au> <199510171837.LAA28008@phaeton.artisoft.com> Sender: owner-hackers@FreeBSD.ORG Precedence: bulk Terry Lambert writes: > > That is slower at the end. However, micro-optimizations here are probably > > not important. Everything except the atomic btrl could be written in C > > and you probably wouldn't notice the difference. > > The attitute that an optimization "doesn't matter" (this one is a bad > example -- it's not really an optimization) is bad. In theory I agree with you. However, in practice I've found that most micro-optimizations make the code *MUCH* (!!!!!) more un-readable, and thus the optimization isn't worth the loss of maintainability. Again, this is a hard call to make, but needs to be mentioned. But, given 'optimized' versions and corresponding 'C' versions of the code is a nice tradeoff. That way a person can (hopefully) see what the code is attempting to do in a more readable manner while still having access to highly optimized implementations as well. Nate