From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#58687: 29.0.50; Enabling pp-use-max-width dramatically slows down formatting of large sexps like org-persist--index Date: Thu, 12 Jan 2023 15:36:25 +0200 Message-ID: <83edrzc1t2.fsf@gnu.org> References: <871qr1cn73.fsf@posteo.de> <87v8lc802g.fsf@localhost> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39332"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 58687@debbugs.gnu.org, m.eliachevitch@posteo.de To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 12 14:37:19 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pFxle-000A3Z-Te for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 12 Jan 2023 14:37:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFxlP-0004lt-Ta; Thu, 12 Jan 2023 08:37:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFxlO-0004lg-Oy for bug-gnu-emacs@gnu.org; Thu, 12 Jan 2023 08:37:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pFxlO-0000Eo-Hm for bug-gnu-emacs@gnu.org; Thu, 12 Jan 2023 08:37:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pFxlO-0001YY-3D for bug-gnu-emacs@gnu.org; Thu, 12 Jan 2023 08:37:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 12 Jan 2023 13:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58687 X-GNU-PR-Package: emacs Original-Received: via spool by 58687-submit@debbugs.gnu.org id=B58687.16735306005955 (code B ref 58687); Thu, 12 Jan 2023 13:37:02 +0000 Original-Received: (at 58687) by debbugs.gnu.org; 12 Jan 2023 13:36:40 +0000 Original-Received: from localhost ([127.0.0.1]:45029 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pFxl1-0001Xx-Kt for submit@debbugs.gnu.org; Thu, 12 Jan 2023 08:36:39 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:59058) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pFxkz-0001Xj-Lf for 58687@debbugs.gnu.org; Thu, 12 Jan 2023 08:36:38 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFxks-00007y-MV; Thu, 12 Jan 2023 08:36:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=FJXWIHXsrLUkv4hS2MYS2n6fR3B7lJSvaEVewP/TZR4=; b=dOsX7RPI6qog D2bBJgVrrdYy4XoROh+XQ1U1r/V1OS7onUTj67MyhNI8fa2YFHGdbuQjeLWagchBqMyve5SZ0NqzB NqtESzBFzR7nn5y/aLHsppmOzZLmb4kYDzgjuQSadrxn5G5RSnQa7OfduqsNXOrYUamNpTyc1izQK /j+ppJRTECA5N+C7yPRrCADtzQywtl4zHsaOojxfMnfKmS+a1Xi/4mG27oFq1huESvcZnld3dIR+V q82PDyIrE7O9sLMp3K4jvOsjEofqqMc3O61opGjStPvMuYOQbtNoi81nP5NpLWQLVIdoG2exuEtTT SWx1eTaODCS3e88zqFKvaA==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFxks-0005OP-5W; Thu, 12 Jan 2023 08:36:30 -0500 In-Reply-To: <87v8lc802g.fsf@localhost> (message from Ihor Radchenko on Thu, 12 Jan 2023 11:27:35 +0000) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:253225 Archived-At: > Cc: 58687@debbugs.gnu.org > From: Ihor Radchenko > Date: Thu, 12 Jan 2023 11:27:35 +0000 > > Michael Eliachevitch writes: > > > I attached a file with the value of my `org-persist--index` expression and a file with a benchmark where I run pp on it, which took me 25s when running it with emacs -Q. Until recently my org persist index was much longer, but I pruned it a bit back when I wasn't aware what exactly caused the slowdown. > > I'd like to bump this bug. Why? > 1. Save the attached files to same folder > 2. Open benchmark-pp-on-org-persist-index.el > 3. M-x eval-buffer > > Observed: (19.617422592 2 1.0353073050000035) > Expected: `pp' not taking ~20sec to write 15k of elisp data. Did you look at what pp.el does when pp-use-max-width is non-nil? I show a profile below, to make that clear. The "regular" pp (when pp-use-max-width is nil) finishes almost instantaneously in this case. 40048 85% - command-execute 40048 85% - call-interactively 40046 85% - funcall-interactively 40046 85% - execute-extended-command 40044 85% - command-execute 40044 85% - call-interactively 40044 85% - funcall-interactively 40044 85% - eval-buffer 40043 85% - let 40042 85% - benchmark-call 40041 85% - # 40041 85% - pp 40041 85% - pp-to-string 40041 85% - pp-emacs-lisp-code 40028 85% - pp--insert-lisp 40028 85% - pp--format-list 40028 85% - pp--insert 38710 82% - pp--insert-lisp 38710 82% - pp--format-list 38708 82% - pp--insert 20781 44% - pp--insert-lisp 20780 44% - pp--format-list 20780 44% - pp--insert 13619 28% - pp--indent-buffer 13603 28% - lisp-indent-line 12595 26% - lisp-ppss 9763 20% - syntax-ppss 6 0% # 1 0% syntax-propertize