GNU bug report logs - #14966
24.3.50; Char-displayable-p is a very long running function

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: minor; Reported by: "Sebastien Vauban" <sva-news@HIDDEN>; dated Sat, 27 Jul 2013 09:49:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 29 Jul 2013 16:25:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 29 12:25:04 2013
Received: from localhost ([127.0.0.1]:56435 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1V3qFr-0001Lx-18
	for submit <at> debbugs.gnu.org; Mon, 29 Jul 2013 12:25:03 -0400
Received: from eggs.gnu.org ([208.118.235.92]:35512)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <eliz@HIDDEN>) id 1V3qFn-0001L8-KU
 for submit <at> debbugs.gnu.org; Mon, 29 Jul 2013 12:25:00 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1V3qFb-0002Zh-88
 for submit <at> debbugs.gnu.org; Mon, 29 Jul 2013 12:24:54 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-103.4 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,
 USER_IN_WHITELIST autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:45278)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1V3qFb-0002ZW-3X
 for submit <at> debbugs.gnu.org; Mon, 29 Jul 2013 12:24:47 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:37169)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1V3qFU-0003du-Sf
 for bug-gnu-emacs@HIDDEN; Mon, 29 Jul 2013 12:24:47 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1V3qFO-0002Ar-6f
 for bug-gnu-emacs@HIDDEN; Mon, 29 Jul 2013 12:24:40 -0400
Received: from mtaout23.012.net.il ([80.179.55.175]:57514)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1V3qFN-0002A4-Td
 for bug-gnu-emacs@HIDDEN; Mon, 29 Jul 2013 12:24:34 -0400
Received: from conversion-daemon.a-mtaout23.012.net.il by
 a-mtaout23.012.net.il (HyperSendmail v2007.08) id
 <0MQP00E00HJEKW00@HIDDEN> for bug-gnu-emacs@HIDDEN;
 Mon, 29 Jul 2013 19:24:32 +0300 (IDT)
Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout23.012.net.il
 (HyperSendmail v2007.08) with ESMTPA id
 <0MQP00EKHHKWJU20@HIDDEN>;
 Mon, 29 Jul 2013 19:24:32 +0300 (IDT)
Date: Mon, 29 Jul 2013 19:24:40 +0300
From: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#14966: 24.3.50;
 Char-displayable-p is a very long running function
In-reply-to: <86d2q16b2b.fsf@HIDDEN>
X-012-Sender: halo1@HIDDEN
To: Sebastien Vauban <sva-news@HIDDEN>
Message-id: <83ob9lxrjr.fsf@HIDDEN>
References: <86d2q4e3m5.fsf@HIDDEN>
 <mailman.1908.1374926410.12400.bug-gnu-emacs@HIDDEN>
 <86d2q16b2b.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: Solaris 10
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.9 (----)
X-Debbugs-Envelope-To: submit
Cc: bug-gnu-emacs@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
Reply-To: Eli Zaretskii <eliz@HIDDEN>
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.9 (----)

> From: "Sebastien Vauban" <sva-news@HIDDEN>
> Date: Mon, 29 Jul 2013 10:10:36 +0200
> 
> I'm striving for a sub-second Emacs startup time, I'm only
> interested in the first time...

The usual way of solving this is to start Emacs only once, and leave
it running at all times.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14966; Package emacs. Full text available.

Message received at 14966 <at> debbugs.gnu.org:


Received: (at 14966) by debbugs.gnu.org; 29 Jul 2013 08:26:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 29 04:26:34 2013
Received: from localhost ([127.0.0.1]:55522 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1V3imn-0006Kr-61
	for submit <at> debbugs.gnu.org; Mon, 29 Jul 2013 04:26:33 -0400
Received: from dd5e0353a.access.telenet.be ([213.224.53.58]:4573
 helo=mail.missioncriticalit.com)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <sva-news@HIDDEN>) id 1V3imi-0006Jo-BM
 for 14966 <at> debbugs.gnu.org; Mon, 29 Jul 2013 04:26:30 -0400
Received: from MUNDANEUM. (unknown [10.10.10.51])
 by mail.missioncriticalit.com (Postfix) with ESMTPS id CE1E2500BAD;
 Mon, 29 Jul 2013 10:18:37 +0200 (CEST)
From: "Sebastien Vauban" <sva-news@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#14966: 24.3.50;
 Char-displayable-p is a very long running function
Organization: Sebastien Vauban
References: <86d2q4e3m5.fsf@HIDDEN>
 <mailman.1910.1374927252.12400.bug-gnu-emacs@HIDDEN>
X-Url: Under construction...
X-Archive: encrypt
Date: Mon, 29 Jul 2013 10:18:26 +0200
In-Reply-To: <mailman.1910.1374927252.12400.bug-gnu-emacs@HIDDEN> (Eli
 Zaretskii's message of "Sat, 27 Jul 2013 13:49:08 +0300")
Message-ID: <8661vt6ap9.fsf@HIDDEN>
User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (windows-nt)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.7 (/)
X-Debbugs-Envelope-To: 14966
Cc: 14966 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.7 (/)

Eli Zaretskii wrote:
>> From: "Sebastien Vauban" <sva-news@HIDDEN>
>> Date: Sat, 27 Jul 2013 11:47:30 +0200
>> 
>> When looking at the performance of my .emacs at startup time, I've noticed
>> that (char-displayable-p) takes around 400 ms (!) to execute itself...
>
> It calls the font driver to actually encode the character.  That could
> look up several fonts.  FWIW, I see 219 ms on my i7 Windows desktop.

FWIW, I can't reproduce it in a minimal Emacs file (and I remember that the
tests were, in fact, done on my wife's laptop, a recent i5).

Minimal Emacs file:

--8<---------------cut here---------------start------------->8---
(defconst em/emacs-load-time-start (float-time))

;; set default font for all frames
;; (modify-all-frames-parameters '((font . "Consolas-10")))              ;; 0.58 s (max 2.13 s on battery)
;; (modify-all-frames-parameters '((font . "Courier New-9")))            ;; 0.58 s (max 2.13 s on battery)
;; (modify-all-frames-parameters '((font . "DejaVu Sans Mono-9")))       ;; 0.07 s (max 0.25 s on battery)
;; (modify-all-frames-parameters '((font . "Lucida Sans Typewriter-9"))) ;; 0.13 s (max 0.48 s on battery)
;; (modify-all-frames-parameters '((font . "Lucida Console-9")))         ;; 0.57 s (max 2.09 s on battery)
;; default (i.e., nothing)                                               ;; 0.58 s (max 1.83 s on battery)

(defadvice message (before leuven-when-was-that activate)
  "Add timestamps to `message' output."
  (ad-set-arg 0 (concat (format-time-string "[%Y-%m-%d %T.")
                        (substring (format-time-string "%N") 0 3)
                        (format-time-string "] ")
                        (ad-get-arg 0))))

(dolist (i '(1 2 3 4 5 6 7 8 9 10))

  (setq org-ellipsis
         (if (char-displayable-p ?\u25B7) ;; white right-pointing triangle
             " \u25B7" ;; string
           'org-ellipsis))

  (message "Call nr %s" i))

(message "Loading Minimal Emacs... Done (in %.2f s)"
         (- (float-time) em/emacs-load-time-start))
--8<---------------cut here---------------end--------------->8---

Notice that the time spent depends a lot on the chosen font!!!  It is quite
constant (at 0.01 s diff when on mains) for one specific font. For another
font, it can be more than 8 x the time (from 0.07 to 0.58 s).

FWIW, I don't understand the timing in the *Messages* buffer:

--8<---------------cut here---------------start------------->8---
For information about GNU Emacs and the GNU system, type C-h C-a.
[2013-07-29 10:08:14.866] Call nr 1
[2013-07-29 10:08:14.869] Call nr 2
[2013-07-29 10:08:14.870] Call nr 3
[2013-07-29 10:08:14.870] Call nr 4
[2013-07-29 10:08:14.871] Call nr 5
[2013-07-29 10:08:14.872] Call nr 6
[2013-07-29 10:08:14.872] Call nr 7
[2013-07-29 10:08:14.873] Call nr 8
[2013-07-29 10:08:14.873] Call nr 9
[2013-07-29 10:08:14.874] Call nr 10
[2013-07-29 10:08:14.874] Loading Minimal Emacs... Done (in 0.58 s)
--8<---------------cut here---------------end--------------->8---

14.874 (after last call) - 14.866 (after first call) is 0.008 s, not really
0.580 s!???

Something really escapes me here.

> Unless char-displayable-p is called in an inner loop (is it?), this
> shouldn't really matter, should it?

I'm not sure to understand this sentence. What do you mean by inner loop?
As I said to Andreas, I'm looking (hard) to get a startup time of Emacs under
the second. So, for that purpose, yes, it does matter. Though, in general, it
certainly does not hurt that much.

Best regards,
  Seb

-- 
Sebastien Vauban




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14966; Package emacs. Full text available.

Message received at 14966 <at> debbugs.gnu.org:


Received: (at 14966) by debbugs.gnu.org; 29 Jul 2013 08:20:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 29 04:20:23 2013
Received: from localhost ([127.0.0.1]:55511 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1V3igi-0005om-GX
	for submit <at> debbugs.gnu.org; Mon, 29 Jul 2013 04:20:23 -0400
Received: from dd5e0353a.access.telenet.be ([213.224.53.58]:64579
 helo=mail.missioncriticalit.com)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <sva-news@HIDDEN>) id 1V3igZ-0005nA-0Y
 for 14966 <at> debbugs.gnu.org; Mon, 29 Jul 2013 04:20:14 -0400
Received: from MUNDANEUM. (unknown [10.10.10.51])
 by mail.missioncriticalit.com (Postfix) with ESMTPS id EE5B8500D51;
 Mon, 29 Jul 2013 10:19:59 +0200 (CEST)
From: "Sebastien Vauban" <sva-news@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#14966: 24.3.50;
 Char-displayable-p is a very long running function
Organization: Sebastien Vauban
References: <86d2q4e3m5.fsf@HIDDEN>
 <mailman.1923.1374934927.12400.bug-gnu-emacs@HIDDEN>
X-Url: Under construction...
X-Archive: encrypt
Date: Mon, 29 Jul 2013 10:19:47 +0200
In-Reply-To: <mailman.1923.1374934927.12400.bug-gnu-emacs@HIDDEN> (Stefan
 Monnier's message of "Sat, 27 Jul 2013 10:21:37 -0400")
Message-ID: <861u6h6an0.fsf@HIDDEN>
User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (windows-nt)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 14966
Cc: 14966 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

Stefan Monnier wrote:
>> when running on mains. If running on battery, that figure would even be
>> multiplied by a factor ~3.5.
>
> By "would be" you mean you haven't actually tried it?

I did not try only that portion of code. The factor 3.5 is what I observe on
my full Emacs config file.

> I'd expect that the 400ms are not all spent waiting for the CPU, but
> some non-negligible part of it is spent waiting for I/O, so it might
> not take much more time with a CPU running 5 times slower.

Best regards,
  Seb

-- 
Sebastien Vauban




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14966; Package emacs. Full text available.

Message received at 14966 <at> debbugs.gnu.org:


Received: (at 14966) by debbugs.gnu.org; 27 Jul 2013 14:21:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 27 10:21:48 2013
Received: from localhost ([127.0.0.1]:52923 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1V35NT-0000Wv-RW
	for submit <at> debbugs.gnu.org; Sat, 27 Jul 2013 10:21:48 -0400
Received: from ironport2-out.teksavvy.com ([206.248.154.182]:56870)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <monnier@HIDDEN>) id 1V35NR-0000WO-8I
 for 14966 <at> debbugs.gnu.org; Sat, 27 Jul 2013 10:21:45 -0400
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: Av8EABK/CFFFpZPn/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCwsOJhIUGA0kiB4GwS2NCYQBA6R6gV6DEw
X-IPAS-Result: Av8EABK/CFFFpZPn/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCwsOJhIUGA0kiB4GwS2NCYQBA6R6gV6DEw
X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="19971298"
Received: from 69-165-147-231.dsl.teksavvy.com (HELO pastel.home)
 ([69.165.147.231])
 by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA;
 27 Jul 2013 10:21:33 -0400
Received: by pastel.home (Postfix, from userid 20848)
 id 7722462E93; Sat, 27 Jul 2013 10:21:37 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: "Sebastien Vauban" <sva-news@HIDDEN>
Subject: Re: bug#14966: 24.3.50;
 Char-displayable-p is a very long running function
Message-ID: <jwvbo5ogk5o.fsf-monnier+emacs@HIDDEN>
References: <86d2q4e3m5.fsf@HIDDEN>
Date: Sat, 27 Jul 2013 10:21:37 -0400
In-Reply-To: <86d2q4e3m5.fsf@HIDDEN> (Sebastien Vauban's message of
 "Sat, 27 Jul 2013 11:47:30 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 14966
Cc: 14966 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.3 (/)

> when running on mains. If running on battery, that figure would even be
> multiplied by a factor ~3.5.

By "would be" you mean you haven't actually tried it?

I'd expect that the 400ms are not all spent waiting for the CPU, but
some non-negligible part of it is spent waiting for I/O, so it might
not take much more time with a CPU running 5 times slower.


        Stefan




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14966; Package emacs. Full text available.

Message received at 14966 <at> debbugs.gnu.org:


Received: (at 14966) by debbugs.gnu.org; 27 Jul 2013 11:59:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 27 07:59:57 2013
Received: from localhost ([127.0.0.1]:52478 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1V33AD-00029b-Er
	for submit <at> debbugs.gnu.org; Sat, 27 Jul 2013 07:59:57 -0400
Received: from plane.gmane.org ([80.91.229.3]:57311)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <public@HIDDEN>) id 1V33AA-00029T-WC
 for 14966 <at> debbugs.gnu.org; Sat, 27 Jul 2013 07:59:55 -0400
Received: from public by plane.gmane.org with local (Exim 4.69)
 (envelope-from <public@HIDDEN>) id 1V33A8-0004Vn-6g
 for 14966 <at> debbugs.gnu.org; Sat, 27 Jul 2013 13:59:52 +0200
Received: from mail-out.m-online.net ([212.18.0.9])
 by plane.gmane.org with esmtp (Exim 4.69)
 (envelope-from <whitebox@HIDDEN>)
 id 1V339u-0004KG-1f; Sat, 27 Jul 2013 13:59:38 +0200
Received: from frontend1.mail.m-online.net (unknown [192.168.8.180])
 by mail-out.m-online.net (Postfix) with ESMTP id 3c2Qgs4q4Qz4KK3d;
 Sat, 27 Jul 2013 13:59:37 +0200 (CEST)
Received: from localhost (dynscan1.mnet-online.de [192.168.6.68])
 by mail.m-online.net (Postfix) with ESMTP id 3c2Qgs40RNzbbcs;
 Sat, 27 Jul 2013 13:59:37 +0200 (CEST)
X-Virus-Scanned: amavisd-new at mnet-online.de
Received: from mail.mnet-online.de ([192.168.8.180])
 by localhost (dynscan1.mail.m-online.net [192.168.6.68]) (amavisd-new,
 port 10024)
 with ESMTP id 0jmQArn97TAu; Sat, 27 Jul 2013 13:59:36 +0200 (CEST)
X-Auth-Info: SNnQZV2WAw2G5sJ2C7N2i3Zf+lrl2Q6uYkIVFp3e0EI=
Received: from igel.home (ppp-93-104-141-187.dynamic.mnet-online.de
 [93.104.141.187]) by mail.mnet-online.de (Postfix) with ESMTPA;
 Sat, 27 Jul 2013 13:59:36 +0200 (CEST)
Received: by igel.home (Postfix, from userid 1000)
 id 2ED38E3296; Sat, 27 Jul 2013 13:59:36 +0200 (CEST)
From: Andreas Schwab <schwab@HIDDEN>
To: "Sebastien Vauban" <public-sva-news-D0wtAvR13HarG/iDocfnWg@HIDDEN>
Subject: Re: bug#14966: 24.3.50;
 Char-displayable-p is a very long running function
References: <86d2q4e3m5.fsf@HIDDEN>
X-Yow: ..  My pants just went on a wild rampage through
 a Long Island Bowling Alley!!
Date: Sat, 27 Jul 2013 13:59:36 +0200
In-Reply-To: <86d2q4e3m5.fsf@HIDDEN> (Sebastien Vauban's message of
 "Sat, 27 Jul 2013 11:47:30 +0200")
Message-ID: <87y58sb4d3.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -1.5 (-)
X-Debbugs-Envelope-To: 14966
Cc: public-14966-ubl+/3LiMTaZdePnXv/OxA@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.5 (-)



"Sebastien Vauban" <sva-news-D0wtAvR13HarG/iDocfnWg@HIDDEN>
writes:

> When looking at the performance of my .emacs at startup time, I've noticed
> that (char-displayable-p) takes around 400 ms (!) to execute itself...

But only the first time.  Once the displaying font is known it runs
fast.

Andreas.

-- 
Andreas Schwab, schwab@HIDDEN
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14966; Package emacs. Full text available.

Message received at 14966 <at> debbugs.gnu.org:


Received: (at 14966) by debbugs.gnu.org; 27 Jul 2013 10:49:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 27 06:49:43 2013
Received: from localhost ([127.0.0.1]:52456 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1V324F-0004z8-0K
	for submit <at> debbugs.gnu.org; Sat, 27 Jul 2013 06:49:43 -0400
Received: from mtaout20.012.net.il ([80.179.55.166]:34689)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <eliz@HIDDEN>) id 1V324B-0004yg-AW
 for 14966 <at> debbugs.gnu.org; Sat, 27 Jul 2013 06:49:40 -0400
Received: from conversion-daemon.a-mtaout20.012.net.il by
 a-mtaout20.012.net.il (HyperSendmail v2007.08) id
 <0MQL00000COLNM00@HIDDEN> for 14966 <at> debbugs.gnu.org;
 Sat, 27 Jul 2013 13:49:06 +0300 (IDT)
Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il
 (HyperSendmail v2007.08) with ESMTPA id
 <0MQL0001NCPU9S90@HIDDEN>;
 Sat, 27 Jul 2013 13:49:06 +0300 (IDT)
Date: Sat, 27 Jul 2013 13:49:08 +0300
From: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#14966: 24.3.50;
 Char-displayable-p is a very long running function
In-reply-to: <86d2q4e3m5.fsf@HIDDEN>
X-012-Sender: halo1@HIDDEN
To: Sebastien Vauban <sva-news@HIDDEN>
Message-id: <83bo5oz3a3.fsf@HIDDEN>
References: <86d2q4e3m5.fsf@HIDDEN>
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 14966
Cc: 14966 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
Reply-To: Eli Zaretskii <eliz@HIDDEN>
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.0 (+)

> From: "Sebastien Vauban" <sva-news@HIDDEN>
> Date: Sat, 27 Jul 2013 11:47:30 +0200
> 
> When looking at the performance of my .emacs at startup time, I've noticed
> that (char-displayable-p) takes around 400 ms (!) to execute itself...

It calls the font driver to actually encode the character.  That could
look up several fonts.  FWIW, I see 219 ms on my i7 Windows desktop.

Unless char-displayable-p is called in an inner loop (is it?), this
shouldn't really matter, should it?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14966; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 27 Jul 2013 09:48:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jul 27 05:48:05 2013
Received: from localhost ([127.0.0.1]:52356 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1V316b-00013K-Dx
	for submit <at> debbugs.gnu.org; Sat, 27 Jul 2013 05:48:05 -0400
Received: from eggs.gnu.org ([208.118.235.92]:35543)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <sva-news@HIDDEN>) id 1V316Z-00012a-7o
 for submit <at> debbugs.gnu.org; Sat, 27 Jul 2013 05:48:04 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <sva-news@HIDDEN>) id 1V316R-0006FY-AO
 for submit <at> debbugs.gnu.org; Sat, 27 Jul 2013 05:47:57 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled
 version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:41665)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <sva-news@HIDDEN>) id 1V316R-0006FP-7n
 for submit <at> debbugs.gnu.org; Sat, 27 Jul 2013 05:47:55 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:37237)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <sva-news@HIDDEN>) id 1V316N-0001nP-CX
 for bug-gnu-emacs@HIDDEN; Sat, 27 Jul 2013 05:47:55 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <sva-news@HIDDEN>) id 1V316K-0006Da-Re
 for bug-gnu-emacs@HIDDEN; Sat, 27 Jul 2013 05:47:51 -0400
Received: from luna.schedom-europe.net ([193.109.184.86]:48746)
 by eggs.gnu.org with smtp (Exim 4.71)
 (envelope-from <sva-news@HIDDEN>) id 1V316K-0006DM-HV
 for bug-gnu-emacs@HIDDEN; Sat, 27 Jul 2013 05:47:48 -0400
Received: (qmail 27749 invoked by uid 507); 27 Jul 2013 11:47:47 +0200
Received: from ip-83-101-44-240.customer.schedom-europe.net (HELO MUNDANEUM.)
 (83.101.44.240)
 by luna.schedom-europe.net with AES128-SHA encrypted SMTP;
 27 Jul 2013 11:47:39 +0200
From: "Sebastien Vauban" <sva-news@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 24.3.50; Char-displayable-p is a very long running function
Organization: Sebastien Vauban
X-Url: Under construction...
X-Archive: encrypt
Date: Sat, 27 Jul 2013 11:47:30 +0200
Message-ID: <86d2q4e3m5.fsf@HIDDEN>
User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (windows-nt)
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -2.7 (--)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.7 (--)

Hello,

When looking at the performance of my .emacs at startup time, I've noticed
that (char-displayable-p) takes around 400 ms (!) to execute itself...

--8<---------------cut here---------------start------------->8---
     (setq org-ellipsis
           (if (char-displayable-p ?\u25B7) ;; white right-pointing triangle
               " \u25B7" ;; string
             'org-ellipsis))) ;; face
--8<---------------cut here---------------end--------------->8---

This figure is obtained on my (recently bought, from January 2013) i7 laptop,
when running on mains. If running on battery, that figure would even be
multiplied by a factor ~3.5.

Best regards,
  Seb

-- 
Sebastien Vauban




Acknowledgement sent to "Sebastien Vauban" <sva-news@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#14966; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 31 Oct 2014 17:00:04 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.