From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Sebastien Vauban" Newsgroups: gmane.emacs.bugs Subject: bug#14966: 24.3.50; Char-displayable-p is a very long running function Date: Mon, 29 Jul 2013 10:18:26 +0200 Organization: Sebastien Vauban Message-ID: <8661vt6ap9.fsf@somewhere.org> References: <86d2q4e3m5.fsf@somewhere.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1375086437 8485 80.91.229.3 (29 Jul 2013 08:27:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 29 Jul 2013 08:27:17 +0000 (UTC) Cc: 14966-ubl+/3LiMTaZdePnXv/OxA@public.gmane.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org-mXXj517/zsQ@public.gmane.org Mon Jul 29 10:27:18 2013 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 1V3inU-0003LP-WE for geb-bug-gnu-emacs@m.gmane.org; Mon, 29 Jul 2013 10:27:17 +0200 Original-Received: from localhost ([::1]:43091 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3inU-0005HB-IX for geb-bug-gnu-emacs@m.gmane.org; Mon, 29 Jul 2013 04:27:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53451) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3inM-0005AP-Ir for bug-gnu-emacs-mXXj517/zsQ@public.gmane.org; Mon, 29 Jul 2013 04:27:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V3inH-0005Yo-H5 for bug-gnu-emacs-mXXj517/zsQ@public.gmane.org; Mon, 29 Jul 2013 04:27:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:32973) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3inH-0005Yj-Dw for bug-gnu-emacs-mXXj517/zsQ@public.gmane.org; Mon, 29 Jul 2013 04:27:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1V3inG-0006N5-Oz for bug-gnu-emacs-mXXj517/zsQ@public.gmane.org; Mon, 29 Jul 2013 04:27:02 -0400 X-Loop: help-debbugs-mXXj517/zsQ@public.gmane.org Resent-From: "Sebastien Vauban" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs-mXXj517/zsQ@public.gmane.org Resent-Date: Mon, 29 Jul 2013 08:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs-mXXj517/zsQ@public.gmane.org X-GNU-PR-Message: followup 14966 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 14966-submit-ubl+/3LiMTaZdePnXv/OxA@public.gmane.org id=B14966.137508639424368 (code B ref 14966); Mon, 29 Jul 2013 08:27:02 +0000 Original-Received: (at 14966) by debbugs.gnu.org; 29 Jul 2013 08:26:34 +0000 Original-Received: from localhost ([127.0.0.1]:55522 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V3imn-0006Kr-61 for submit-ubl+/3LiMTaZdePnXv/OxA@public.gmane.org; Mon, 29 Jul 2013 04:26:33 -0400 Original-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 ) id 1V3imi-0006Jo-BM for 14966-ubl+/3LiMTaZdePnXv/OxA@public.gmane.org; Mon, 29 Jul 2013 04:26:30 -0400 Original-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) X-Url: Under construction... X-Archive: encrypt In-Reply-To: (Eli Zaretskii's message of "Sat, 27 Jul 2013 13:49:08 +0300") User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (windows-nt) X-BeenThere: debbugs-submit-ubl+/3LiMTaZdePnXv/OxA@public.gmane.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs-mXXj517/zsQ@public.gmane.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-mXXj517/zsQ@public.gmane.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org-mXXj517/zsQ@public.gmane.org Xref: news.gmane.org gmane.emacs.bugs:76755 Archived-At: Eli Zaretskii wrote: >> From: "Sebastien Vauban" >> 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