From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail
From: Noam Postavsky <npostavs@gmail.com>
Newsgroups: gmane.emacs.bugs
Subject: bug#36566: 27.0.50; debug is sometimes horribly slow
Date: Wed, 31 Jul 2019 21:05:01 -0400
Message-ID: <87h871u24i.fsf@gmail.com>
References: <87r26yvb4r.fsf@web.de> <871ryy2l1t.fsf@gmail.com>
 <87r26xjyon.fsf@web.de> <877e8llbzo.fsf@runbox.com>
 <8736ilaepu.fsf@runbox.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226";
	logging-data="248669"; mail-complaints-to="usenet@blaine.gmane.org"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2.90 (gnu/linux)
Cc: Michael Heerdegen <michael_heerdegen@web.de>, 36566@debbugs.gnu.org,
 Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Gemini Lasswell <gazally@runbox.com>
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 01 03:06:16 2019
Return-path: <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org>
Envelope-to: geb-bug-gnu-emacs@m.gmane.org
Original-Received: from lists.gnu.org ([209.51.188.17])
	by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
	(Exim 4.89)
	(envelope-from <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org>)
	id 1hszXs-0012Xs-I3
	for geb-bug-gnu-emacs@m.gmane.org; Thu, 01 Aug 2019 03:06:16 +0200
Original-Received: from localhost ([::1]:45332 helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.86_2)
	(envelope-from <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org>)
	id 1hszXr-0006w6-5f
	for geb-bug-gnu-emacs@m.gmane.org; Wed, 31 Jul 2019 21:06:15 -0400
Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53571)
 by lists.gnu.org with esmtp (Exim 4.86_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1hszXk-0006vx-7m
 for bug-gnu-emacs@gnu.org; Wed, 31 Jul 2019 21:06:09 -0400
Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1hszXh-0008RV-Gf
 for bug-gnu-emacs@gnu.org; Wed, 31 Jul 2019 21:06:07 -0400
Original-Received: from debbugs.gnu.org ([209.51.188.43]:44459)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1hszXe-0008Q6-C1
 for bug-gnu-emacs@gnu.org; Wed, 31 Jul 2019 21:06:03 -0400
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1hszXe-0006L0-3z
 for bug-gnu-emacs@gnu.org; Wed, 31 Jul 2019 21:06:02 -0400
X-Loop: help-debbugs@gnu.org
Resent-From: Noam Postavsky <npostavs@gmail.com>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Thu, 01 Aug 2019 01:06:02 +0000
Resent-Message-ID: <handler.36566.B36566.156462151024292@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 36566
X-GNU-PR-Package: emacs
Original-Received: via spool by 36566-submit@debbugs.gnu.org id=B36566.156462151024292
 (code B ref 36566); Thu, 01 Aug 2019 01:06:02 +0000
Original-Received: (at 36566) by debbugs.gnu.org; 1 Aug 2019 01:05:10 +0000
Original-Received: from localhost ([127.0.0.1]:53279 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1hszWn-0006Jj-UF
 for submit@debbugs.gnu.org; Wed, 31 Jul 2019 21:05:10 -0400
Original-Received: from mail-io1-f43.google.com ([209.85.166.43]:45548)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <npostavs@gmail.com>) id 1hszWm-0006JW-HZ
 for 36566@debbugs.gnu.org; Wed, 31 Jul 2019 21:05:09 -0400
Original-Received: by mail-io1-f43.google.com with SMTP id g20so140574522ioc.12
 for <36566@debbugs.gnu.org>; Wed, 31 Jul 2019 18:05:08 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; 
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version;
 bh=D1U9aZopTh1KNQJvq2wxmPaJt84SqvtKOcG4VDZvqaE=;
 b=Mbt4UD65CKooT7EhjNqZcqvdjpmfTZYn5x1+LaiRd6SNLAXNFW0w48E1XcP0IfN08H
 3m4tYlmIS+R6Nen1htdXT1/iN/rb1fbp4+gI2GjXH5xMLnHPxBMEYfXG1X5yWRUa667a
 EkrPiPanXWHzQQsBGXnrEiLVjPqYNOsOh3JJ8kGGZalwmECNgg3yPpeNF+hVmd5MQsqq
 74TNHw53JzYrkd6GSpEY6hjhh5NIcaWvvFTjEdxFxhRAm2SUw7ovmxW6iLnrsKpuofgx
 6pTUjYdZ0l0MA4rp1vspoA+6QVJmiz0Nf1BsexLVhoGZEPJyB+i2WtNDAKIDC3I/RyGn
 r9/g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version;
 bh=D1U9aZopTh1KNQJvq2wxmPaJt84SqvtKOcG4VDZvqaE=;
 b=XxTM2CK7HwekcTQ9c67dQvGlZhIi/ULc1UuFuA5KTVBM6jCatbvydNjEFAjiNU+djI
 kAtqfpCVcQL7S0RgjqXCHoqalwUwiPpZV9zAuG9G6PbkJd1mGJbXIyJ2MMOBP/DUrfiR
 ceHr0n+iGjuqYFW02G/4lBpQzIweFCpYEhis0oZWjfO4bZaVN32aX7Up05YsorCr3dt9
 j6biaMr8xHYS8CCxcAgA/tBT8CryRZwlN+tGk0d26Zbdi8BY/iUh1YtKyx1tYC5p53nN
 u33taNn5bfV4MnyrtrN6GRV14pwKPYsFKFtn1Cq5UUyFYtBVaL/oKBY50rZgzEp6+PIT
 vqyw==
X-Gm-Message-State: APjAAAU9LWng1eMINkyqe3ZnQuuF6QjDEbPyry0nPD/ulN9ZpCvfD4IZ
 0xCu+vOKoFd3F6P7LgnOxM4=
X-Google-Smtp-Source: APXvYqx4BHmbm1hk8FtymTVau68htrMfCqiIv4RsONuMYR2J0hVISecYYSgktVbjlkE/fJ2808rZ+w==
X-Received: by 2002:a5d:8a06:: with SMTP id w6mr26889819iod.267.1564621503065; 
 Wed, 31 Jul 2019 18:05:03 -0700 (PDT)
Original-Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34])
 by smtp.gmail.com with ESMTPSA id
 m25sm40470555ion.35.2019.07.31.18.05.01
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Wed, 31 Jul 2019 18:05:02 -0700 (PDT)
In-Reply-To: <8736ilaepu.fsf@runbox.com> (Gemini Lasswell's message of "Wed,
 31 Jul 2019 17:53:17 -0700")
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: 209.51.188.43
X-BeenThere: bug-gnu-emacs@gnu.org
List-Id: "Bug reports for GNU Emacs,
 the Swiss army knife of text editors" <bug-gnu-emacs.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/bug-gnu-emacs>
List-Post: <mailto:bug-gnu-emacs@gnu.org>
List-Help: <mailto:bug-gnu-emacs-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=subscribe>
Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org
Original-Sender: "bug-gnu-emacs"
 <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org>
Xref: news.gmane.org gmane.emacs.bugs:164198
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/164198>

Gemini Lasswell <gazally@runbox.com> writes:

> The third patch attached below fixes that by adding a macro to
> cl-print.el to wrap the printing of all the simple things with
> let-bindings of print-circle and print-gensym to nil.

> Patch #3 has the advantage of being straightforward logically and not
> breaking anything which doesn't use cl-prin1, but it undoubtedly also
> slows down cl-prin1 in the probably more common case that print-gensym
> and print-circle are both nil.  There are other ways to fix this, such
> as by adding a new entry point in print.c for printing simple strings,
> or by modifying the logic in print_preprocess to not create a hash table
> if the top-level object is a string with no properties.

This last idea sounds like a straightforward win to me, with no obvious
drawbacks.  I mean, no point in allocating a hash table if we can
cheaply detect it will never be used, right?