From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#25122: 24.5; function describe-variable hangs on large variables Date: Sat, 11 Mar 2017 10:21:53 -0500 Message-ID: References: <20161206022112.GF25778@E15-2016.optimum.net> <87twahk19y.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1489245805 16694 195.159.176.226 (11 Mar 2017 15:23:25 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 11 Mar 2017 15:23:25 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: 25122@debbugs.gnu.org To: Thierry Volpiatto Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 11 16:23:18 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cmirQ-0002op-3c for geb-bug-gnu-emacs@m.gmane.org; Sat, 11 Mar 2017 16:23:12 +0100 Original-Received: from localhost ([::1]:43752 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cmirU-0000IG-Dm for geb-bug-gnu-emacs@m.gmane.org; Sat, 11 Mar 2017 10:23:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59280) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cmirN-0000I8-Mt for bug-gnu-emacs@gnu.org; Sat, 11 Mar 2017 10:23:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cmirG-0006Bx-9Y for bug-gnu-emacs@gnu.org; Sat, 11 Mar 2017 10:23:09 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:53416) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cmirG-0006Bd-5k for bug-gnu-emacs@gnu.org; Sat, 11 Mar 2017 10:23:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cmirF-00013L-UB for bug-gnu-emacs@gnu.org; Sat, 11 Mar 2017 10:23:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 11 Mar 2017 15:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25122 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25122-submit@debbugs.gnu.org id=B25122.14892457363976 (code B ref 25122); Sat, 11 Mar 2017 15:23:01 +0000 Original-Received: (at 25122) by debbugs.gnu.org; 11 Mar 2017 15:22:16 +0000 Original-Received: from localhost ([127.0.0.1]:51615 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cmiqW-000123-E4 for submit@debbugs.gnu.org; Sat, 11 Mar 2017 10:22:16 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:52775) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cmiqT-00011p-CP for 25122@debbugs.gnu.org; Sat, 11 Mar 2017 10:22:14 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0ASCQAFFcRY/3OXCkxdGgEBAQECAQEBAQgBAQEBg1FBihOFeJEHAZcfGoYCBAICgkBEFAECAQEBAQEBAWsohRYGViMQCzQSFBgNJIoTtCSKYAEBAQEGAgEliz2KOQWQWotnnHyGYpF/gUQ2IYEEIxYILIUXHoIBIoouAQEB X-IPAS-Result: A0ASCQAFFcRY/3OXCkxdGgEBAQECAQEBAQgBAQEBg1FBihOFeJEHAZcfGoYCBAICgkBEFAECAQEBAQEBAWsohRYGViMQCzQSFBgNJIoTtCSKYAEBAQEGAgEliz2KOQWQWotnnHyGYpF/gUQ2IYEEIxYILIUXHoIBIoouAQEB X-IronPort-AV: E=Sophos;i="5.36,147,1486443600"; d="scan'208";a="295032164" Original-Received: from 76-10-151-115.dsl.teksavvy.com (HELO pastel.home) ([76.10.151.115]) by smtp.teksavvy.com with ESMTP; 11 Mar 2017 10:22:06 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 98CA761875; Sat, 11 Mar 2017 10:21:53 -0500 (EST) In-Reply-To: <87twahk19y.fsf@gmail.com> (Thierry Volpiatto's message of "Tue, 06 Dec 2016 07:41:13 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:130487 Archived-At: > (cl-letf (((symbol-function 'pp) > (lambda (object &optional stream) > (let ((fn (lambda (ob &optional stream) > (princ (pp-to-string ob) > (or stream standard-output)) > (terpri))) > (print-circle t)) > (if (consp object) > (progn > (insert "\n(") > (mapc fn object) > (cl-letf (((point) (1- (point)))) > (insert ")"))) > (funcall fn object stream)))))) Hmm... I wonder why this would be faster. In the past, the implementation of `print-circle` had a poor complexity, but we fixed that around Emacs-24, IIRC so it now uses a hash-table and should have O(n) complexity, which means that pp shouldn't be slower than (mapc #'pp). Stefan