From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id WGZIJjLjnGIf3gAAbAwnHQ (envelope-from ) for ; Sun, 05 Jun 2022 19:09:06 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id oJ0oJjLjnGL/LQAA9RJhRA (envelope-from ) for ; Sun, 05 Jun 2022 19:09:06 +0200 Received: from mail.notmuchmail.org (yantan.tethera.net [IPv6:2a01:4f9:c011:7a79::1]) (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 6C5E22E0E4 for ; Sun, 5 Jun 2022 19:09:06 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 128CB5F419; Sun, 5 Jun 2022 17:09:03 +0000 (UTC) Received: from fethera.tethera.net (fethera.tethera.net [IPv6:2607:5300:60:c5::1]) by mail.notmuchmail.org (Postfix) with ESMTP id 9C8805E023 for ; Sun, 5 Jun 2022 17:09:00 +0000 (UTC) Received: by fethera.tethera.net (Postfix, from userid 1001) id 6AC405FBD7; Sun, 5 Jun 2022 13:08:59 -0400 (EDT) Received: (nullmailer pid 1595558 invoked by uid 1000); Sun, 05 Jun 2022 17:08:57 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: WIP/RFP: lazy body insertion for notmuch-show mode Date: Sun, 5 Jun 2022 14:08:48 -0300 Message-Id: <20220605170851.1595387-1-david@tethera.net> X-Mailer: git-send-email 2.35.2 MIME-Version: 1.0 Message-ID-Hash: SYUSQ6HVYQJIU4MNIBLMMTS3BNR2F6O6 X-Message-ID-Hash: SYUSQ6HVYQJIU4MNIBLMMTS3BNR2F6O6 X-MailFrom: bremner@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; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: DE ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1654448946; 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:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post; bh=etl4vZgmmbFSbAaIOPyZ1+UTuBpXU8VxCW/xc7LUlgc=; b=k2Ao/oXiUanrgGRFoJ290OMjAaxtAKiDUy9lJ1tn5tzK1pKYunTNB5o6msFw6Ow8s1xiXD WcpwaIBZEbbNvbXn1lxBSw95bTlMEQ6lG9pmi87vowUp+rRXoocELAYUBo9pI63/aBVRep akyZZiQz6hemIjo30eZa6lGMAbCszZrb4QpxPtrXT3rIL2PGnuQ6F1dm6MkxuKpZQ6JOzp lv1Lmrg7l7w/FH4pAyaA2D27xy+9/Yv2O575ENeoPMsiahpMgw3odL/y9RAvuIFt3PIq8l y4gKZ5dlwhHSgsYRy29auR+NIoZm4ghbLlFZHwd+C4FEF0MMmIidofkmE7VjAg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1654448946; a=rsa-sha256; cv=none; b=EI0AfPpeyzegkKWEta7qBNDegilad1TUSvimpVjLvxgojLemYMo5joR3I/hvctq0Q0RNHE /jaXtQVBmVeMMSqQDpRQgLMVypZDuRq2dX+0wZ47M+3+39k1K15TXtFvRszSplHNwbVf6K YjqxQf86KPMMqT/poPEMTGBNg7Zk18Isp4rpJrktR543ihTSYT+gChupf76hLoBLn8aXNP fI7JyQaV4PdDnHqBCZqAr91Pv3YIdmXhO/WMDMph+swFy/yLMyjO8S+DP08qnE0L6J3PyK WVp7uKd56/eqg1Yzaler8R573+eH6CDtAN8t2lKPfHqpHrB5Ja6Q5eHpX06BIA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -1.06 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 6C5E22E0E4 X-Spam-Score: -1.06 X-Migadu-Scanner: scn0.migadu.com X-TUID: STl0xuls65IH Many people have observed that notmuch-show is slow to render large threads. This is pretty annoying when most of the thread is off screen. The usual trick of working asynchronously doesn't seem hopeful, since most of the work is in emacs proper, not externally. This series attempts to reduce the amount of time before emacs is responsive again by deferring the rendering of messages below a certain depth in the tree until the user manually triggers it, via a button. It isn't clear that depth is the best heuristic, but this seems like an improvement on the status quo. Other heuristics could be added later. I thought about some kind of "expose events" triggering the rendering but I'm not sure that's better (and it seems harder). With this approach the user can skip a few levels down the tree to render the message they are interested in. I learned while writing this that "text-buttons" might be faster. I'm not sure my test thread of 264 messages is long enough to see the difference. It would be helpful if people could test expanding message bodies and see if there is an annoying lag. You will need to customize the variable notmuch-show-depth-limit to test.