From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#12541: Prefer plain 'static' to 'static inline'. Date: Sun, 30 Sep 2012 10:58:57 -0700 Organization: UCLA Computer Science Department Message-ID: <50688861.2090306@cs.ucla.edu> References: <5067FC19.3000704@cs.ucla.edu> <83d313et6t.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1349027990 32473 80.91.229.3 (30 Sep 2012 17:59:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 30 Sep 2012 17:59:50 +0000 (UTC) Cc: 12541@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 30 19:59:55 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TINnz-0002nA-9l for geb-bug-gnu-emacs@m.gmane.org; Sun, 30 Sep 2012 19:59:51 +0200 Original-Received: from localhost ([::1]:44100 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TINnu-00060S-17 for geb-bug-gnu-emacs@m.gmane.org; Sun, 30 Sep 2012 13:59:46 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:45907) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TINnr-0005zj-3d for bug-gnu-emacs@gnu.org; Sun, 30 Sep 2012 13:59:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TINnp-0000Wl-A6 for bug-gnu-emacs@gnu.org; Sun, 30 Sep 2012 13:59:43 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53601) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TINnp-0000Wd-4b for bug-gnu-emacs@gnu.org; Sun, 30 Sep 2012 13:59:41 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TINoA-0003ji-Oj for bug-gnu-emacs@gnu.org; Sun, 30 Sep 2012 14:00:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 30 Sep 2012 18:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12541 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 12541-submit@debbugs.gnu.org id=B12541.134902797414298 (code B ref 12541); Sun, 30 Sep 2012 18:00:02 +0000 Original-Received: (at 12541) by debbugs.gnu.org; 30 Sep 2012 17:59:34 +0000 Original-Received: from localhost ([127.0.0.1]:34914 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TINni-0003iZ-2E for submit@debbugs.gnu.org; Sun, 30 Sep 2012 13:59:34 -0400 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:59187) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TINne-0003iO-RP for 12541@debbugs.gnu.org; Sun, 30 Sep 2012 13:59:31 -0400 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 561C139E8015; Sun, 30 Sep 2012 10:59:08 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id y2OU-VjVkPmh; Sun, 30 Sep 2012 10:59:07 -0700 (PDT) Original-Received: from [192.168.1.3] (pool-108-23-119-2.lsanca.fios.verizon.net [108.23.119.2]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 87B4E39E800E; Sun, 30 Sep 2012 10:59:07 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20120912 Thunderbird/15.0.1 In-Reply-To: <83d313et6t.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:65031 Archived-At: On 09/30/2012 02:49 AM, Eli Zaretskii wrote: > Since what version of GCC we can trust that static functions are > inlined? Since pretty long ago. From the online documentation GCC has been inlining functions not explicitly declared 'inline' since at least GCC 2.95.3, the oldest manual that's at gcc.gnu.org. (The documentation talks about C++ functions not C, but the underlying technology applies to C too, and I'd be surprised if C differed.) The exact set of functions that are inlined depends on the platform and compiler options, as well as the compiler version. > The inline functions in bidi.c _must_ be inlined for performance > reasons. Well, as Jason said, 'inline' is just advice and GCC doesn't always inline them even now. On my platform (GCC 4.7.2 -O3, x86-64, Fedora 17, trunk bzr 110287) GCC does not always inline 'bidi_char_at_pos': in a couple of cases the function is only partly inlined. With the proposed change, the set of functions that are not always inlined expands to bidi_cache_iterator_state, bidi_char_at_pos, and bidi_fetch_char, and (if we also include functions that are partially inlined) bidi_cache_search and bidi_get_type. This is all with the same platform as before. I don't offhand see how this would slow down Emacs significantly, as these functions are fairly large. Is there some benchmark I could try out, to see the performance effects that are of concern here?