From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#25122: 24.5; function describe-variable hangs on large variables Date: Sat, 11 Mar 2017 10:35:24 -0500 Message-ID: <878tob9683.fsf@users.sourceforge.net> 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 1489246527 31936 195.159.176.226 (11 Mar 2017 15:35:27 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 11 Mar 2017 15:35:27 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) Cc: 25122@debbugs.gnu.org, Thierry Volpiatto To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 11 16:35:24 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 1cmj3A-0007Ke-6Q for geb-bug-gnu-emacs@m.gmane.org; Sat, 11 Mar 2017 16:35:20 +0100 Original-Received: from localhost ([::1]:43793 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cmj3D-0002Lh-5O for geb-bug-gnu-emacs@m.gmane.org; Sat, 11 Mar 2017 10:35:23 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34464) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cmj2y-0002Hz-UG for bug-gnu-emacs@gnu.org; Sat, 11 Mar 2017 10:35:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cmj2u-0003N1-1g for bug-gnu-emacs@gnu.org; Sat, 11 Mar 2017 10:35:08 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:53425) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cmj2t-0003Me-Tb for bug-gnu-emacs@gnu.org; Sat, 11 Mar 2017 10:35:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cmj2t-0001Kn-NH for bug-gnu-emacs@gnu.org; Sat, 11 Mar 2017 10:35:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 11 Mar 2017 15:35:03 +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.14892464565059 (code B ref 25122); Sat, 11 Mar 2017 15:35:03 +0000 Original-Received: (at 25122) by debbugs.gnu.org; 11 Mar 2017 15:34:16 +0000 Original-Received: from localhost ([127.0.0.1]:51623 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cmj27-0001JW-Q7 for submit@debbugs.gnu.org; Sat, 11 Mar 2017 10:34:15 -0500 Original-Received: from mail-it0-f43.google.com ([209.85.214.43]:36682) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cmj25-0001J6-8D for 25122@debbugs.gnu.org; Sat, 11 Mar 2017 10:34:14 -0500 Original-Received: by mail-it0-f43.google.com with SMTP id h10so10758319ith.1 for <25122@debbugs.gnu.org>; Sat, 11 Mar 2017 07:34:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=l9aOv3KQQrdm3yZNOivGFGSpjO6KSQU+1QXQP+8c0ps=; b=lUp33aOJVRV8CIsKo3s9qBCBvDHmP5oy7XTV3v6s4Exy0VyhGF0nR/osv7bEtoLGaZ QSTi8wGJcon8CLJfz3qTtS2JBwWazKuzJozC18XhEYlEmgILAuUP7RgxSyMoCfTQ1POd +wCbLZmgAb0NfFZq3E/eIHhsY74nBNRWYeugdQ7ZwqbGh4WUIRt1UfK4xiTJpDbrT3tz L2lE8QuprJbFGDnL8rsqVgimeZbdOq3thAYLxeXvl7Na0xg6K3TQp4LOSD6yMXbqFBrQ XaKuaSj1fVPSXAAITeWeEjsOGT21p0tUDalIeHH7FIqeZvhs/Mvbn+xzU7oRYi64mm+n xaGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=l9aOv3KQQrdm3yZNOivGFGSpjO6KSQU+1QXQP+8c0ps=; b=Qvhpk9cllz2Z5wI38m10vJzR0J+3yOkVPSiAYq5Iox0rKo/XV0ELMt6T8f/hP+UJ8t bzMuAA9FeBmZfyS88BxRnkOYgNQgM2W1hHI3WYzTvBdaZt0BKcxkDmVBcMoHJMbhMKMt sHDNto+YMZXBAq0zOFsVwDHB7XFsqffugGFWhU7y1XTFDhBuA45dJR0EQJl/hKUXNgm9 X5XZMTSmoh0K9vxvRblKMEYSdk1cAHHtYznBw72eaH8wD+fiBy4EHl7umTOhBBLJO8b7 GPc8M8ffPgf/NPZxdScTn3VcHSUQOHagEPcvq0bfWoxoES9opXS8g7SixT1i/y2/CMin YPog== X-Gm-Message-State: AFeK/H2ffTswcKRwOyry3qKYIFkRF7vrPkVHMyECV8OuskRiwFwBdFDmrRguAu/9w8HgGA== X-Received: by 10.36.219.10 with SMTP id c10mr3642359itg.1.1489246447482; Sat, 11 Mar 2017 07:34:07 -0800 (PST) Original-Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id s90sm5831680ioe.12.2017.03.11.07.34.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 11 Mar 2017 07:34:07 -0800 (PST) In-Reply-To: (Stefan Monnier's message of "Sat, 11 Mar 2017 10:21:53 -0500") 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:130489 Archived-At: Stefan Monnier writes: >> (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). I think it's because when we indent-sexp only on individual entries, we don't parse as far back.