Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757859AbXIFLfS (ORCPT ); Thu, 6 Sep 2007 07:35:18 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755801AbXIFLfG (ORCPT ); Thu, 6 Sep 2007 07:35:06 -0400 Received: from cantor2.suse.de ([195.135.220.15]:57415 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755224AbXIFLfE (ORCPT ); Thu, 6 Sep 2007 07:35:04 -0400 To: Oleg Verych Cc: Nick Piggin , Linux Kernel Mailing List , David Miller , Paul McKenney Subject: Re: Fast path efficiency (Re: [rfc][patch] dynamic data structure switching) References: <20070902182738.GA13145@wotan.suse.de> <20070902183618.GB13145@wotan.suse.de> From: Andi Kleen Date: 06 Sep 2007 13:35:02 +0200 In-Reply-To: Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 778 Lines: 16 Oleg Verych writes: > > What is more efficient in general sense, > as opposed to s,3,2,1,0 Optimized? In general it shouldn't matter at all on any reasonably modern CPU (let's say less than 10 years old) unless you do it tens of thousands of times in a loop. Also gcc has reasonable default heuristics for this kind of stuff anyways (e.g. return NULL or return negative value is predicted unlikely by default) Cache misses are far more important to care about because they cost hundreds of cycles. -Andi - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/