From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id yPDeMObcS2FGCgEAgWs5BA (envelope-from ) for ; Thu, 23 Sep 2021 03:48:22 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id IECbLObcS2GRTgAA1q6Kng (envelope-from ) for ; Thu, 23 Sep 2021 01:48:22 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [IPv6:2607:5300:201:3100::1657]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id BC4DE21AEE for ; Thu, 23 Sep 2021 03:48:21 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id B98C426D2F; Wed, 22 Sep 2021 21:48:17 -0400 (EDT) Received: from fethera.tethera.net (fethera.tethera.net [IPv6:2607:5300:60:c5::1]) by mail.notmuchmail.org (Postfix) with ESMTP id 0722A26D2E for ; Wed, 22 Sep 2021 21:48:14 -0400 (EDT) Received: by fethera.tethera.net (Postfix, from userid 1001) id B96635FD5C; Wed, 22 Sep 2021 21:48:14 -0400 (EDT) Received: (nullmailer pid 883003 invoked by uid 1000); Thu, 23 Sep 2021 01:48:13 -0000 From: David Bremner To: Alan Schmitt , notmuch Subject: Re: performance in emacs displaying a huge thread In-Reply-To: <87ilytvrb4.fsf@m4x.org> References: <877e1sr378.fsf@polytechnique.org> <877e1s4gsg.fsf@swing.csc.kth.se> <874kvsp2ni.fsf@polytechnique.org> <87tuk81tqj.fsf@tethera.net> <87mtpca7d4.fsf@m4x.org> <878s0w12fm.fsf@tethera.net> <878s0v9swk.fsf@m4x.org> <87o89qzzb5.fsf@tethera.net> <87wnnauznr.fsf@m4x.org> <87lf3qt80i.fsf@tethera.net> <87lf3quhu4.fsf@m4x.org> <87h7eeszv8.fsf@tethera.net> <87ilytvrb4.fsf@m4x.org> Date: Wed, 22 Sep 2021 22:48:13 -0300 Message-ID: <87mto4awpu.fsf@tethera.net> MIME-Version: 1.0 Message-ID-Hash: YALO3URWZWVMLGX2XTN2R7AFJFMFUYBH X-Message-ID-Hash: YALO3URWZWVMLGX2XTN2R7AFJFMFUYBH X-MailFrom: david@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1632361701; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=scmJ5HCQMMwWsvj2sKCjnPRHlXu53vuEOH6P3QLwoQY=; b=oKLgp+tGLtSVN0i18azNoShsMGPf/6wbH8wRACHl9HW7DpvdxSsvCVHb1H0/anUKb+2efo rZ65IshDoACUbleBJWULBJWcgIp+tpwMIxyzrWhHwrXs5WsB0+SGJCdHlG2s9TtZBBZ/g8 XMIJ81NlJpJKXIAbCMZE/7ztAjRK2aSvpxwCjnZjimmjbOgZOynfXG1zA5f7OnHwX1pqWe 1gwFcNr08oDJjqGScB2OBkJvuhXG8A1QUZTztjyMpC2RPLmWt4ACDtQNDZDUIjI/VhtNmK DnBia4b5BDY1bZgYgJiKYAMjRodNOhS4UCao6tYTpqzUgsLs5iBVnw03ZT26XA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1632361701; a=rsa-sha256; cv=none; b=Fs2xELGaw1/TGJd64jXQwdnVBBQcbMklF/1Jteab304rbpQ8EskYxrRnv/5WXxWtelwfbG jMJTZxuuPmvZ/LjRd/ZIIoWuX/9oF3vTb85DcCI30qM2cVy5rL/NPhhpEJP7CrXWgfQz5n 5liE4tm0gWtu4XXiZs99Sj+YnY1hC7LHCRNVHerkhhz1i9qe/gCXX2o+27zB5MeIZhPu9v JxnaOkirmMHKpCSUAMapKT/5ZkArznBl0qkKWlBt08OR78/YwWDqrml3WxmyOdKq7FyDMy 2KWTVzh7a+mA576xfNgoNwDQmi4jP+GplC22tZ5CcS4L6+14eFh/wW71vyknlg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -2.13 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: BC4DE21AEE X-Spam-Score: -2.13 X-Migadu-Scanner: scn0.migadu.com X-TUID: 0UyI/IW5KxMv Alan Schmitt writes: > > I can view a thread with more than 7000 messages (with > show-only-matching-messages to t) if they are not encrypted. In fact I > already could with 0.32 if I remember correctly. The fact that messages > are encrypted seems to matter here. I've been unable to replicate this deep recursion. Whenever I'm in unthreaded search view, I have one message summary on every line, and when I trace through notmuch-show-insert-tree, (let ((msg (car tree)) (replies (cadr tree))) always assigns nil (empty list) to replies. That means my call stack has exactly one instance of notmuch-show-insert-tree. > > If it matters, here is the bottom of the debug stack: > > notmuch-show-insert-thread(((nil ((nil ((nil nil) (nil (... ...))))))) 1) > notmuch-show-insert-tree((nil ((nil ((nil ((nil nil) (nil ...))))))) 0) > #f(compiled-function (tree) #)((nil ((nil ((nil ((nil nil) (nil ...)))))))) > mapc(#f(compiled-function (tree) #) ((nil ((nil ((nil (... ...)))))))) > notmuch-show-insert-thread(((nil ((nil ((nil (... ...))))))) 0) > #f(compiled-function (thread) #)(((nil ((nil ((nil (... ...)))))))) > mapc(#f(compiled-function (thread) #) (((nil ((nil ((nil ...)))))))) > notmuch-show-insert-forest((((nil ((nil ((nil ...)))))))) > notmuch-show--build-buffer() > notmuch-show("id:Mr.ye1AxFHsd2E.Vd_oS17awSv@polytechnique.org") > notmuch-tree-show-message-out() > notmuch-tree-show-message(nil) > funcall-interactively(notmuch-tree-show-message nil) > call-interactively(notmuch-tree-show-message nil nil) > command-execute(notmuch-tree-show-message) On possibility is that there some old version of the code that you are running. Inside notmuch-show-insert-tree, the variable notmuch-show-single-message should be 't', whether called from regular tree-mode or an unthreaded search. As an experiment, you could try redefining (defun notmuch-show-insert-tree (tree depth) "Insert the message tree TREE at depth DEPTH in the current thread." (let ((msg (car tree)) (replies (cadr tree))) (message "nreplies %d flag %s" (length replies) notmuch-show-single-message) ;; We test whether there is a message or just some replies. (when msg (notmuch-show-insert-msg msg depth)) (notmuch-show-insert-thread replies (1+ depth)))) this will log the number of replies and flag value. For me, it logs "nreplies 0 flag t"