From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id KMkfEv3ibmRkVAAASxT56A (envelope-from ) for ; Thu, 25 May 2023 06:24:29 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id KHLvEf3ibmRVJwEAauVa8A (envelope-from ) for ; Thu, 25 May 2023 06:24:29 +0200 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 E69A73F7DF for ; Thu, 25 May 2023 06:24:28 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q22Vq-00082c-Tw; Thu, 25 May 2023 00:23:42 -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 1q22Vp-00082S-EZ for emacs-orgmode@gnu.org; Thu, 25 May 2023 00:23:41 -0400 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q22Vm-0005C8-PF for emacs-orgmode@gnu.org; Thu, 25 May 2023 00:23:41 -0400 Received: by mail-pg1-x534.google.com with SMTP id 41be03b00d2f7-53404873a19so808150a12.3 for ; Wed, 24 May 2023 21:23:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684988616; x=1687580616; h=mime-version:reply-to:date:subject:to:from:user-agent:message-id :from:to:cc:subject:date:message-id:reply-to; bh=J4O9ZDJqpwg++CJ1rEZSanlWBvMS8HDTaGXS1/gHz7c=; b=DXNFvO2z8GxHY8yHlmH+4xC/Xo1R13lF+qUnVRvxh7BQz/SIhSMPYRPYK7oiqoAmn8 vitAU+ZQ6xvwDtbKc9vaRfIenxQRzuYT3ndf1FL+KY3pe+hk8t/UZsQclZpyCd+tEAoH xLP/mVxKGoVkfbCF3G0PBfkD5jeGN3aJf8JZFurEGJUu2fFm7VtG/x3aGLCgcgVveoJS 5JOuaGW19/rZ3vDkS4KKo9c8BIeWcEDCwl0OqRFg2wrstIEKmbvmGfyHhhIye9rhGvOR AWa02FSObT3efODx4DtOcE8nK8Nb5u9vPtRn2J7TghveNPRJH8/nshb4DTWg1MlrztJT vIhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684988616; x=1687580616; h=mime-version:reply-to:date:subject:to:from:user-agent:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=J4O9ZDJqpwg++CJ1rEZSanlWBvMS8HDTaGXS1/gHz7c=; b=IbpenXfpP4PwSJUZzUMXywIIBV3+YTEPKxDHJBncav3HKltXCFAyzzpnkTqEdBd6Sv 7tsxY/1OuDAzfuXcyLF2TUVnuE3fVMJb1pu5Y9C2a3W+xGqYFZ0VBnQAJIKgMLw0qPbD 4Ghc0NUTt/sxXZfD3v+/LE2IfgyDSs06l2uS3NNj9qFwyzKfpiqbo5i5PA+5N7rJTeFe FsN+PTJ1sKBj2v0FrFxt5E/xk9WMAJ309YB/LNvAhUr5GrKhJ/GEYUabQFCU1k4+hwHU jWFTeSGuND2u1JXtbhyUMYNXmaKEUkMFpdaICvjogaEcBI1kv6kTvu66WMUJ+3R7Pcpg Hg2Q== X-Gm-Message-State: AC+VfDwnDlTNuG4UfwKdTxzhCP4KdQ/WRBB779HCOr9IAZdyq42vbzIK 3iE+tBJj+UWltmVPd4PahQLvfykxvFO4 X-Google-Smtp-Source: ACHHUZ61rSjl5IZ60F4+bcpxKFkiaPFT86xD50D80zqgDQLf3P1Cf0Kdvqbkt9y9I125KAAHuOpGxw== X-Received: by 2002:a17:902:bc82:b0:1ad:eeea:32d7 with SMTP id bb2-20020a170902bc8200b001adeeea32d7mr254454plb.48.1684988616344; Wed, 24 May 2023 21:23:36 -0700 (PDT) Received: from Mac-mini.local ([39.171.214.79]) by smtp.gmail.com with ESMTPSA id n14-20020a170902e54e00b001a2135e7eabsm297221plf.16.2023.05.24.21.23.35 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 24 May 2023 21:23:35 -0700 (PDT) Message-ID: <646ee2c7.170a0220.bc877.0cfa@mx.google.com> X-Google-Original-Message-ID: Received: by Mac-mini.local (Postfix, from userid 501) id 654139054521; Thu, 25 May 2023 12:23:29 +0800 (CST) User-agent: mu4e 1.10.3; emacs 30.0.50 From: "Christopher M. Miles" To: Org mode (mailing-list) Subject: [QUESTION] Hope to improve the `org-set-font-lock-defaults` performance by lazy and limit to current visible area Date: Thu, 25 May 2023 12:13:18 +0800 MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Received-SPF: pass client-ip=2607:f8b0:4864:20::534; envelope-from=numbchild@gmail.com; helo=mail-pg1-x534.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Reply-To: numbchild@gmail.com 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 ARC-Seal: i=1; s=key1; d=yhetil.org; t=1684988668; a=rsa-sha256; cv=none; b=J0Z36vmeMABptX4BMILa4745+gcG5UzyDcycNa6wltqKH6R55Uy3drDfVsywTckWUcSCxU KZSvTPK9+owEs8Z4v8tQhQBd+xe94aELBKxgQKWL/qXAfPnd9IkZ4Zc6JGHKAiniBteRqO e2VZB6MhLeCVK1OS/wqt0ZU/zvGCVVPkm/Zl4hy7PmyuR9s029TSgiI2ZUWsRJlALR7lU1 VVs21O4+D9y8WtyJ/p7M9qjz2x9Y1zd/jv8O4KCkRjZOCkOa5sO0KPSIhku4XDMlthxURA xH7894JKXvPMXKwrZ2TNW2sGkXz8aS3q8rwnpvIDUGl3tVCzvwFX8yYab2XPqw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=DXNFvO2z; dmarc=pass (policy=none) header.from=gmail.com; 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=1684988668; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=J4O9ZDJqpwg++CJ1rEZSanlWBvMS8HDTaGXS1/gHz7c=; b=BVkIx4MKTS0t2orOcUuBTxtNlPY3DZs4Cyg/gkEl7Om6KcbPkJhs3Reyqb6qyj+D4Kef53 51vM7EY5siSdBlxmsLkoSEpRGG3O7kP6vvUScT0JhQ8bSpFu8+pOOkEDat6Bpd2NEks2aY btcO1peHX37HuMhOQJ6Fd99qO8w3n4ulddYyKxOH2Sg0V4BLr1M0S79pVIxgaWYcf9yH7f ZUHVH5fSIFT19szu/pKmDXDo8or9rRnvhuEMEpC1EqWfk0eZoauPQ9+7X2k4D+qKX0e8TR ykciqNBPh3jc60PnLqeayRgIXsk6W0v5c39HPPEDACLcum5p0fSzHj+8fh0XFg== X-Migadu-Spam-Score: -9.87 X-Spam-Score: -9.87 X-Migadu-Queue-Id: E69A73F7DF X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=DXNFvO2z; dmarc=pass (policy=none) header.from=gmail.com; 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" X-TUID: DJMxcohfi/dN --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable I'm the developer of Org mode package "org-link-beautify" https://repo.or.cz/org-link-beautify.git . The package main theory is to use org-link-parameters `:activate-func` to do link file preview with generating thumbnail images or file content etc. But I found it's slow one some big Org file and slow on small Org file when previewing has a lot. I locate and studied the source code of the `:activate-func`. =2D [X] locate the core function source code + [X] org-link-set-parameters - [X] org-link-parameters + [X] :activate-func + [X] org-mode major mode definition + [X] org-set-font-lock-defaults - Set font lock defaults for the curre= nt buffer. - [X] variable: org-font-lock-extra-keywords - dynamically scoped + [X] org-activate-links - [X] org-activate-links--text-properties + [X] :activate-func - [X] org-activate-links--overlays + [X] :activate-func I can see the `org-mode` invoked `org-set-font-lock-defaults` soon when `org-mode` enabled. I hope the link `:activate-func` function can be called only on link elements which is VISIBLE (means unfolded subtrees or similar). So org-mode don't need to render all buffer links at beginning soon. Instead render them as needed as unfolded. (Maybe I read source code without fully understand the code. If so, correct me, thanks.) So, I hope Org mode maintainer can improve this mechanism. Thanks a lot. Hope this can improve other Org mode extensions performance too. =2D-=20 [ stardiviner ] I try to make every word tell the meaning that I want to express without mi= sunderstanding. Blog: https://stardiviner.github.io/ IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAmRu4r4ACgkQG13xyVro msMIBwf9FobFxeF8JAGEceC2uvXuecRDEXYrFoMH0FBqyAjmS0paaBlBDyI8rAbi 9LKmi3Pc/l3FPm3O1pK+00z7jpOZD//WSoTldW6+weXI453a442sgt8DCU/taecZ LnoORDZN69U8823NCFmAVhKG/kotxgTNo/liSPjTiEvoyCMFrYKvCi5+w7HMFS6c mzB7fnROCiD87yz5dpzqtV29RlZNrUK6IJs7xJLELEoLztfL9J3y7IvGgvXvyhG8 RcFeEKg+Gx7OwxBwXavRIYM55CJleTGHiZy2Wo03vFYh7qj4jFUwqMuX1t1FAc+Y AR1A3YxpKg6OPraLUyqIQK8n5lMEcQ== =lquP -----END PGP SIGNATURE----- --=-=-=--