From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Tue, 8 Dec 2009 19:32:56 -0500 To: 9fans@9fans.net Message-ID: <94720e19021f594c5f0007d2b975d14f@brasstown.quanstro.net> In-Reply-To: <> References: <> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] etherigbe.c using _xinc? Topicbox-Message-UUID: ad80c132-ead5-11e9-9d60-3106f5b1d025 > but the former does two operations and the latter > only one. your claim was that _xinc is slower > than incref (== lock(), x++, unlock()). but you are > timing xinc+xdec against incref. sure. i was looking it as a kernel version of a semaphore. back to the original problem, before allocb/freeb did 2 lock/unlocks. now it does 2 unlock/locks + 2 xinc/xdec, and is, in the best case 31% slower. and in the worst case 90% slower. the reference counting is a heavy price to pay on every network block, when it is only used by ip/gre.c. - erik