From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#12541: Prefer plain 'static' to 'static inline'. Date: Mon, 01 Oct 2012 19:14:00 +0200 Message-ID: <83fw5yazdz.fsf@gnu.org> References: <5067FC19.3000704@cs.ucla.edu> <83d313et6t.fsf@gnu.org> <50688861.2090306@cs.ucla.edu> <83y5jrcqe7.fsf@gnu.org> <506893EF.8080604@cs.ucla.edu> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1349112254 633 80.91.229.3 (1 Oct 2012 17:24:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 1 Oct 2012 17:24:14 +0000 (UTC) Cc: 12541@debbugs.gnu.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Oct 01 19:24:19 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 1TIjZs-0003bj-Jk for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 Oct 2012 19:14:44 +0200 Original-Received: from localhost ([::1]:34660 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TIjZn-0003j5-1N for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 Oct 2012 13:14:39 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36080) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TIjZk-0003i9-Gp for bug-gnu-emacs@gnu.org; Mon, 01 Oct 2012 13:14:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TIjZj-0001ci-Dl for bug-gnu-emacs@gnu.org; Mon, 01 Oct 2012 13:14:36 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:55320) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TIjZj-0001ce-A6 for bug-gnu-emacs@gnu.org; Mon, 01 Oct 2012 13:14:35 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TIjaA-00068K-Cg for bug-gnu-emacs@gnu.org; Mon, 01 Oct 2012 13:15:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 Oct 2012 17:15: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.134911166623521 (code B ref 12541); Mon, 01 Oct 2012 17:15:02 +0000 Original-Received: (at 12541) by debbugs.gnu.org; 1 Oct 2012 17:14:26 +0000 Original-Received: from localhost ([127.0.0.1]:36633 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TIjZa-00067J-D3 for submit@debbugs.gnu.org; Mon, 01 Oct 2012 13:14:26 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:46275) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TIjZW-00067A-L5 for 12541@debbugs.gnu.org; Mon, 01 Oct 2012 13:14:24 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MB80060050XTE00@a-mtaout20.012.net.il> for 12541@debbugs.gnu.org; Mon, 01 Oct 2012 19:13:53 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MB80062457578B0@a-mtaout20.012.net.il>; Mon, 01 Oct 2012 19:13:53 +0200 (IST) In-reply-to: <506893EF.8080604@cs.ucla.edu> X-012-Sender: halo1@inter.net.il 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:65088 Archived-At: > Date: Sun, 30 Sep 2012 11:48:15 -0700 > From: Paul Eggert > CC: 12541@debbugs.gnu.org > > >> 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. > > > > Were they also not inlined before the change? > > Most of these functions were inlined before the change. However, as > described above, bidi_char_at_pos was only partially inlined before > the change. It surprises me that bidi_char_at_pos is only partially inlined, or not at all, since its body is just this: static inline int bidi_char_at_pos (ptrdiff_t bytepos, const unsigned char *s, bool unibyte) { if (s) { s += bytepos; if (unibyte) return *s; } else s = BYTE_POS_ADDR (bytepos); return STRING_CHAR (s); } Perhaps that's because STRING_CHAR could call a function? Likewise with bidi_get_type. This one was supposed to be as fast as the C ctype macros, or close. Handa-san told me that the uniprop tables he implemented for this should really be fast. Maybe again the problem is that CHAR_TABLE_REF can call a function? Anyway, it's disturbing that the functions you mention will no longer be inlined, because they are at the lowest level of walking the buffer and deciding what to do with the next character. In particular, bidi_get_type and bidi_fetch_char are invoked for every character we display, even if there's no R2L characters anywhere in sight. (By contrast, bidi_cache_iterator_state and bidi_cache_search will only be invoked if we bump into an R2L character.) Nevertheless, I'm okay with removing the 'inline' qualifier from bidi.c. If the performance hit is significant, I'm sure we will hear from users shortly. Otherwise, I'll try to measure the performance with and without 'inline' when I have time, and we can take it from there.