From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12524 invoked by alias); 11 Apr 2012 06:55:55 -0000 Received: (qmail 12512 invoked by uid 22791); 11 Apr 2012 06:55:54 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from sunsite.ms.mff.cuni.cz (HELO sunsite.mff.cuni.cz) (195.113.15.26) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 11 Apr 2012 06:55:39 +0000 Received: from sunsite.mff.cuni.cz (localhost [127.0.0.1]) by sunsite.mff.cuni.cz (8.14.5/8.14.5) with ESMTP id q3B6tWbO011147; Wed, 11 Apr 2012 08:55:32 +0200 Received: (from jj@localhost) by sunsite.mff.cuni.cz (8.14.5/8.14.5/Submit) id q3B6tVJE011144; Wed, 11 Apr 2012 08:55:31 +0200 Date: Wed, 11 Apr 2012 06:55:00 -0000 From: Jakub Jelinek To: Lawrence Crowl Cc: Richard Guenther , Bernd Schmidt , Gabriel Dos Reis , David Edelsohn , Diego Novillo , gcc Subject: Re: Switching to C++ by default in 4.8 Message-ID: <20120411065531.GL6148@sunsite.ms.mff.cuni.cz> Reply-To: Jakub Jelinek References: <20120409182200.GI6148@sunsite.ms.mff.cuni.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2012-04/txt/msg00382.txt.bz2 On Tue, Apr 10, 2012 at 06:35:58PM -0700, Lawrence Crowl wrote: > The standard says they need not ignore them. > > I was thinking more about iterating over the contents. What in the > current code is an indirect function call inside of a loop becomes > mostly be inline functions in a C++ iterator style. The loop is now > fully graspable by the optimizer. That comes with its cost though, as we have hundreds of hashtables for various kinds of types, you'd get hundreds of different instantiations of the hash table code. hashtab.c is significantly more I-cache friendly than that. If a hash table doesn't need to be rehashed and the *with_hash routines are used, only the eq_f callback is called a few times (on each collision). Jakub