From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id qNNSBO/H6WZlBwEAqHPOHw:P1 (envelope-from ) for ; Tue, 17 Sep 2024 18:18:23 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id qNNSBO/H6WZlBwEAqHPOHw (envelope-from ) for ; Tue, 17 Sep 2024 20:18:23 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=hNhxlJK+; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1726597102; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=L26vcLrmEnXRZDFu2L+w7WDGPRgmrm19iu0zCVDZj38=; b=VMaHkKcYpQGJcj9iPG7dAWMp+94jAtGa8YVnzjGFLtYkzCH+YPCGJYm26dA1qQDuWjUCsB DtShlIZSH/dEYqdAyxAFEcmQQyeWTnZfWSPR3tL7YAYj8Xo9/n36Qx2v7NnsBS2JAuEUbf ubtP1iq0MHcjeANdajd8JuRMl7+oiCJj922DmL197OeU8uj+nvvpc05p7Rdq0ghNvTEYqv kTauwK5zc+/bmfJYyI2ShkVbxbbCFE2ljwXfPg1VZnJhJwLsN9zVzrk+pCyZ1/PQMPm97s tzJ6+XIq1fuhNnS83TFE626Cv202FdlmWHu2fc2SCL/b/qHFXkSHT1f/PbZZ+A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1726597102; a=rsa-sha256; cv=none; b=ULQ0dFMucE9kMhKV354WyQpAUtQXPSBahG3isE6xBPTGceNBhc40wpezFJEl95+u0BXFlz FsOQBPV118fCIygC7NO+DmGumRZdZs3HgJNebNhofzL1Ho/J9RbP85ua9eLx4Wembm2DVn v8TdRjGGj5LBifGsvn39s+N25UqRk/aJ5vwItidDQn7pXdq+8OwAcvTUBDCyG+TYj7I/zZ UxHvFQqk1eLIXFpEewNMdsraPICpSFP5P01lJy8zmAE8rt34zio8C6HA8kdw9AdInhwbBu 8nefl1z1m8PoPRDZA509uvApnJXuzf2mLs1+3sFpDj2XkKM9p6+0ESqQ5sbgTw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=hNhxlJK+; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D263E6C177 for ; Tue, 17 Sep 2024 20:18:22 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sqcjS-0004oa-Ie; Tue, 17 Sep 2024 14:15:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sqciv-0001wl-SR for emacs-orgmode@gnu.org; Tue, 17 Sep 2024 14:14:53 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sqcir-00030n-A9 for emacs-orgmode@gnu.org; Tue, 17 Sep 2024 14:14:47 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 005AD240027 for ; Tue, 17 Sep 2024 20:14:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1726596881; bh=tcVPaRYKhpF8Jth+lV1IRqSyxBXu17Ly9OiIPWEzOUE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=hNhxlJK+bcZiqEGVz0t6mq7h9NG+kYoshrZYG6nz/1c4SBCjEllLTaqvjOYDeQEB6 fFmeuouVBFnZbiUMahbS7AVC3us8+/MzcMnm33d8oPIPwQfDAgx7TpcyxIGHIGS+uJ oKXQ8vXY4ayXhk7zo1ycjADs6Z0KNV1+ODhnS1gpUORnpMzsdKhDj2D8P/K7dbrEL5 kjDWWchcuMXIXa2f5IvBZ4XXHf8a3tZ6fl0K4XY24CTqBmayFZTAMJSFO9N+GIEHSC anwEdsfPPOCadgnM/68sQ0knwosSGV11t6RKHgz4ls/liMuyx30T/zz4RVUUtGLetr pKGZHA2UzhQGg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4X7VL61t0wz6txL; Tue, 17 Sep 2024 20:14:38 +0200 (CEST) From: Ihor Radchenko To: Karthik Chikmagalur Cc: stardiviner , Org mode Subject: Re: [PATCH v4] Inline image display as part of a new org-link-preview system In-Reply-To: <8734m060ma.fsf@gmail.com> References: <6461a84b.a70a0220.b6d36.5d00@mx.google.com> <66a8b73b.170a0220.383476.996e@mx.google.com> <87o75yhwnu.fsf@localhost> <87v7zyyvm3.fsf@localhost> <87frr07xz8.fsf@gmail.com> <87cym38aj8.fsf@gmail.com> <87r0ajawgj.fsf@localhost> <87a5h77zb1.fsf@gmail.com> <87msl4wv8d.fsf@localhost> <875xrqg6cb.fsf@gmail.com> <874j70n559.fsf@localhost> <87msksabld.fsf@gmail.com> <87jzfwljkq.fsf@localhost> <87h6b09v4o.fsf@gmail.com> <878qwb8qw1.fsf@localhost> <878qw9ak6a.fsf@gmail.com> <87o74ypp3b.fsf@localhost> <87r09rxpjg.fsf@gmail.com> <87h6ah72ui.fsf@localhost> <8734m060ma.fsf@gmail.com> Date: Tue, 17 Sep 2024 18:16:13 +0000 Message-ID: <87o74mjgcy.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -5.31 X-Spam-Score: -5.31 X-Migadu-Scanner: mx13.migadu.com X-Migadu-Queue-Id: D263E6C177 X-TUID: DfvbQFLG5yrA Karthik Chikmagalur writes: >> It means that you are scheduling every single preview batch to fire at >> the same time. I think that the timers here should run sequentially - >> (1) fire the first batch without delay; (2) wait org-link-preview-delay >> and fire the next batch; (3) ... > > Done, and tested preview run timings to be sure. There are still edge cases. Consider a buffer with large number of images (I just tested with my notes.org that has 1000+ images): 1. I run preview on the whole buffer 2. M-x list-timers shows the timer, and it is ugly: * 10.0s - #f(compiled-function () # [(#0) ((((org-link-preview-file # "/home/yantar92/.data/a3/4fcf3a-28c5-42cb-b8cc-eb98dcdb5338/stress-strain-DA1P5.png" (link (:standard... [the line spans thousands of characters further - rendering timer list takes a good 10+ sec] - So, no closures please. Use normal named functions - It may also be a good idea to manage preview queue globally, so that subsequent preview requests can be merged automatically (see below) 3. It will take a long time to preview all those images, so I get impatient and cancel the previews. The timer still remains... 4. I request previews in the whole buffer again. Now, there are two timers. This may be repeated, and the user may end up with many useless idle timers - each of them will take a long time to end, because "preview batches" do not care whether we actually try to preview images or skip them because the underlying overlays were "canceled" by another command - I think that the timers should not group images in batches beforehand, but simply consume images from a single queue until a given number of images are actually submitted for preview generation (overlays are still present). And please fix the compiler warnings. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at