From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] comment-cache 223d16f 2/3: Apply `comment-depth' text properties when calling `back_comment'. Date: Sun, 13 Mar 2016 18:15:38 -0700 Organization: UCLA Computer Science Department Message-ID: <56E610BA.6000204@cs.ucla.edu> References: <20160309174816.GE3948@acm.fritz.box> <56E0805F.3050804@gmx.at> <20160312170839.GE2572@acm.fritz.box> <56E45B90.3090905@gmx.at> <56E45E72.2010801@cs.ucla.edu> <56E4640F.1000808@gmx.at> <20160312193626.GA10781@acm.fritz.box> <56E53232.80209@gmx.at> <20160313115239.GB1871@acm.fritz.box> <56E55838.2090000@gmx.at> <20160313124958.GC1871@acm.fritz.box> <56E56BF5.907@gmx.at> <83vb4qdzt2.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------010608050405030902070501" X-Trace: ger.gmane.org 1457918174 29554 80.91.229.3 (14 Mar 2016 01:16:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 14 Mar 2016 01:16:14 +0000 (UTC) Cc: acm@muc.de, emacs-devel@gnu.org To: Eli Zaretskii , martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 14 02:16:06 2016 Return-path: Envelope-to: ged-emacs-devel@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 1afH77-0007in-15 for ged-emacs-devel@m.gmane.org; Mon, 14 Mar 2016 02:16:05 +0100 Original-Received: from localhost ([::1]:38437 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afH73-0001fP-6H for ged-emacs-devel@m.gmane.org; Sun, 13 Mar 2016 21:16:01 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41032) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afH6p-0001f1-W3 for emacs-devel@gnu.org; Sun, 13 Mar 2016 21:15:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1afH6o-0003sl-Vi for emacs-devel@gnu.org; Sun, 13 Mar 2016 21:15:47 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:59057) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afH6j-0003sJ-1u; Sun, 13 Mar 2016 21:15:41 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 3B361160F8A; Sun, 13 Mar 2016 18:15:40 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id nOcGSX96gcyl; Sun, 13 Mar 2016 18:15:39 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 709E8160FB7; Sun, 13 Mar 2016 18:15:39 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id oYW-pEOrP7lO; Sun, 13 Mar 2016 18:15:39 -0700 (PDT) Original-Received: from [192.168.1.9] (pool-100-32-155-148.lsanca.fios.verizon.net [100.32.155.148]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 20173160F8A; Sun, 13 Mar 2016 18:15:39 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 In-Reply-To: <83vb4qdzt2.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 131.179.128.68 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:201665 Archived-At: This is a multi-part message in MIME format. --------------010608050405030902070501 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Eli Zaretskii wrote: > Here are my results, with today's emacs-25 and master: > > emacs-25 master emacs-25.0.92 emacs-23.3 > foo 33.375 33.89 2.859 1.375 > bar 213.250 213.578 15.547 8.625 I get somewhat different results: when comparing Emacs 24.2 to Emacs master, 24.2 is 8% faster with -O2, 25% faster with -Og, and 3x faster with -O0. So, although there's a bit of slowdown otherwise (which should get looked at, at some point), the main culprit is -O0, and it probably is due to -O0's not inlining functions. A quick build with --enable-profiling and CFLAGS=-O0 suggests that the primary bottlenecks with -O0 are CHAR_TABLE_REF_ASCII (18%), make_lisp_symbol (15%), builtin_lisp_symbol (11%), and PSEUDOVECTORP (6%). I suppose we could spend some time trying to make these go faster when compiling with -O0, but I think our time is better spent asking developers to use -Og, or to use -O0 more selectively. I used master commit 181e92c4e060a7ce4740b561375f9ec9f473f144 src/xdisp.c, with Emacs built on Fedora 23 x86-64 (GCC 5.3.1): foo bar 24.2 -O2 2.4 13 24.2 -Og 3.0 17 24.2 -O0 5.2 32 master -O2 2.6 14 master -Og 3.8 21 master -O0 15 96 Fedora 23 can't build Emacs 23.3 due to some minor portability problems in 23.3, so I didn't benchmark that. I used the attached Lisp code to benchmark. --------------010608050405030902070501 Content-Type: text/x-emacs-lisp; name="bench-rudalics.el" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="bench-rudalics.el" (defun foo () (interactive) (while (not (eobp)) (c-end-of-defun))) (defun bar () (interactive) (while (not (bobp)) (c-beginning-of-defun))) (defun bench () (find-file "xdisp.c") (goto-char (point-min)) (let* ((t1 (current-time)) (t2 (progn (foo) (current-time))) (t3 (progn (bar) (current-time)))) (cons (float-time (time-subtract t2 t1)) (float-time (time-subtract t3 t2))))) --------------010608050405030902070501--