From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id yDK+CliAJ2CWDAAA0tVLHw (envelope-from ) for ; Sat, 13 Feb 2021 07:31:36 +0000 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id OIVkBliAJ2AVFgAAbx9fmQ (envelope-from ) for ; Sat, 13 Feb 2021 07:31:36 +0000 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 38C941F158 for ; Sat, 13 Feb 2021 08:31:34 +0100 (CET) Received: from localhost ([::1]:42970 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lApOv-00007h-9D for larch@yhetil.org; Sat, 13 Feb 2021 02:31:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:54174) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lApNb-00007V-Rs for emacs-orgmode@gnu.org; Sat, 13 Feb 2021 02:30:12 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:40943) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lApNX-0001br-KU for emacs-orgmode@gnu.org; Sat, 13 Feb 2021 02:30:11 -0500 Received: by mail-wm1-x332.google.com with SMTP id o24so1858341wmh.5 for ; Fri, 12 Feb 2021 23:30:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:thread-topic:thread-index:date:message-id :references:in-reply-to:reply-to:accept-language:content-language :mime-version; bh=EflDvuoVgMXeJoT1+2tDibn7Axakw5Zidq0vVFxC2uE=; b=I6EqNbJub9LZcQiiIUiiyd3iFpef26ikB2UG4VsJ1ftC83j3+5kwlm6YPD/XJcY3h0 4pEbmTHuygORPbwRr0lXwJ9AUJJ1ENEEDE7y2/f2TfzI0U4kISB9gi3g7bgru0ZkzXRC RDAN2YlkmpaK/IC/DEWBf9EKxF6rZUV95o6Y8FYJrQXiZMUiBgD50pXIsW8iekq7hqVd HEnZo1LEgNUzYCqTN9JVgJx96q+OKy4HV6Bsl52x6fnnRDw9yfLQ6rkWS76KbYFlflkN Jm0EzrRNbrRwDGWuQPuA4OiFV7ijexc3vd1e51ZRXjWuaVzWmHvuMlKWR8xNPbjdSk5o EAdQ== 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:thread-topic:thread-index :date:message-id:references:in-reply-to:reply-to:accept-language :content-language:mime-version; bh=EflDvuoVgMXeJoT1+2tDibn7Axakw5Zidq0vVFxC2uE=; b=JdscLZuLnHtCdTfFprKfvgxq8yuURTZmub0NUgH7rSahXlha/fObeFg3ssT8KvAObG u/CNsVQMK20dsfssR0MCKlfq4awp31RSXJXdB8WuCUdbTmlCTAV4DdAN2ZbaAVaPq+2q zDkMDNm1yZKCASkKpWvKmIbmCV6Lgc5nyQYREpRXmww/AEP+9lIMOKrCItiYsuz7q40B RRYfgooMR0Puv774WjoqjD3c1bK/dPtyAV4CZ0Odae27U7kS9A5LfS0GUacuHJsX01PS W8VIh5TTkmSPQgQAcR5Ff/Tg4RNDWpyfKbeg0dSnViqtGRJWykBo+1sWsECxPpYEcMf1 ubtA== X-Gm-Message-State: AOAM531OZFxmCCeSUsIn9aY1oqtmlQMB/6OkLSZV6QRFLuCsE/2RFngG fiZDt/xmv93gpJE+JmGPnQ== X-Google-Smtp-Source: ABdhPJz7ihRp1vjsDDWTanYpCdS7tdj4INmYju86kblwN8AxenlZnHr8LTpP9Q8rpARpZhkhpWKoGA== X-Received: by 2002:a05:600c:47d7:: with SMTP id l23mr5655169wmo.16.1613201404485; Fri, 12 Feb 2021 23:30:04 -0800 (PST) Received: from PAXPR08MB6640.eurprd08.prod.outlook.com ([2603:1026:c0a:1::5]) by smtp.gmail.com with ESMTPSA id i3sm13302425wrr.19.2021.02.12.23.30.03 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Feb 2021 23:30:03 -0800 (PST) Received: from dark (183.246.145.70) by HK2PR03CA0062.apcprd03.prod.outlook.com (2603:1096:202:17::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3868.12 via Frontend Transport; Sat, 13 Feb 2021 07:11:36 +0000 From: Christopher Miles To: Ihor Radchenko Subject: Re: Is it possible to optimize Org Mode org-activate-links ? Thread-Topic: Is it possible to optimize Org Mode org-activate-links ? Thread-Index: AQHXAaUDeoQlAxgaaUimNLu9WXNfW6pVbr4AgAA8kAA= X-MS-Exchange-MessageSentRepresentingType: 1 Date: Sat, 13 Feb 2021 07:11:38 +0000 Message-ID: References: <87eehktze5.fsf@localhost> In-Reply-To: <87eehktze5.fsf@localhost> Accept-Language: zh-TW, en-US Content-Language: en-US X-MS-Exchange-Organization-AuthAs: Internal X-MS-Exchange-Organization-AuthMechanism: 06 X-MS-Exchange-Organization-AuthSource: PAXPR08MB6640.eurprd08.prod.outlook.com X-MS-Has-Attach: yes X-MS-Exchange-Organization-Network-Message-Id: 20c91863-668e-4e78-1808-08d8cfee9af8 X-MS-Exchange-Organization-SCL: -1 X-MS-TNEF-Correlator: X-MS-Exchange-Organization-RecordReviewCfmType: 0 x-clientproxiedby: HK2PR03CA0062.apcprd03.prod.outlook.com (2603:1096:202:17::32) To PAXPR08MB6640.eurprd08.prod.outlook.com (2603:10a6:102:dd::5) Content-Type: multipart/mixed; boundary="_004_PAXPR08MB6640F9A31608E3D1A737FCA2A38A9PAXPR08MB6640eurp_" MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=numbchild@gmail.com; helo=mail-wm1-x332.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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Christopher Miles Cc: Org Mode Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: 1.84 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=I6EqNbJu; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 38C941F158 X-Spam-Score: 1.84 X-Migadu-Scanner: scn1.migadu.com X-TUID: 1+q2eW+Nbebx --_004_PAXPR08MB6640F9A31608E3D1A737FCA2A38A9PAXPR08MB6640eurp_ Content-Type: multipart/alternative; boundary="_000_PAXPR08MB6640F9A31608E3D1A737FCA2A38A9PAXPR08MB6640eurp_" --_000_PAXPR08MB6640F9A31608E3D1A737FCA2A38A9PAXPR08MB6640eurp_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <#secure method=3Dpgpmime mode=3Dsign> Thanks for your hints. Should I use the following options? I saw the warning. Does this freeze hap= pens often? I decide to try it. (defvar org-element-use-cache nil "Non-nil when Org parser should cache its results. WARNING: for the time being, using cache sometimes triggers freezes. Therefore, it is disabled by default. Activate it if you want to help debugging the issue.") (defvar org-element-cache-sync-idle-time 0.6 "Length, in seconds, of idle time before syncing cache.") (defvar org-element-cache-sync-duration 0.04 "Maximum duration, as a time value, for a cache synchronization. If the synchronization is not over after this delay, the process pauses and resumes after `org-element-cache-sync-break' seconds.") (defvar org-element-cache-sync-break 0.3 "Duration, as a time value, of the pause between synchronizations. See `org-element-cache-sync-duration' for more information.") Ihor Radchenko writes: Christopher Miles writes: I checked org-element-context source code, it's not so long and complex. Wh= y it caused so many items in Memory profiler result? Is it possible to opti= mize it? You can try to use org-element-cache. That might help. Best, Ihor --_000_PAXPR08MB6640F9A31608E3D1A737FCA2A38A9PAXPR08MB6640eurp_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

<#secure method=3Dpgpmime mode=3Dsign>

Thanks for your hints.

Should I use the following options? I saw the warning. Does this freeze = happens often? I decide to try it.

(<=
span style=3D"color: #0000FF;">defvar "Non-nil when Org parser shoul=
d cache its results.

WARNING: for the time being, using ca=
che sometimes triggers
freezes.  Therefore, it is disabled b=
y default.  Activate it if
you want to help debugging the issue.=
")

(defvar org-element-cache-sync-idl=
e-time 0.6
  "Length, in seconds, of idle t=
ime before syncing cache.")

(defvar org-element-cache-sync-dur=
ation 0.04
  "Maximum duration, as a time v=
alue, for a cache synchronization.
If the synchronization is not over af=
ter this delay, the process
pauses and resumes after `org-element-cache-sync-break'
seconds.")

(defvar org-element-cache-sync-bre=
ak 0.3
  "Duration, as a time value, of=
 the pause between synchronizations.
See `org-element-cache-sync-duration)

Ihor Radchenko <yantar92@gmail.com> writes:

Christopher Miles <numbchild@gmail.com> writes:
I checked org-element-context source code, it's not so long and comple= x. Why it caused so many items in Memory profiler result? Is it possible to= optimize it?

You can try to use org-element-cache. That might help.

Best, Ihor

--_000_PAXPR08MB6640F9A31608E3D1A737FCA2A38A9PAXPR08MB6640eurp_-- --_004_PAXPR08MB6640F9A31608E3D1A737FCA2A38A9PAXPR08MB6640eurp_ Content-Type: text/plain; name="ATT00001.txt" Content-Description: ATT00001.txt Content-Disposition: attachment; filename="ATT00001.txt"; size=593; creation-date="Sat, 13 Feb 2021 07:11:38 GMT"; modification-date="Sat, 13 Feb 2021 07:11:38 GMT" Content-ID: Content-Transfer-Encoding: base64 LS0gDQpbIHN0YXJkaXZpbmVyIF0NCiAgICAgICBJIHRyeSB0byBtYWtlIGV2ZXJ5IHdvcmQgdGVs bCB0aGUgbWVhbmluZyB0aGF0IEkgd2FudCB0byBleHByZXNzLg0KDQogICAgICAgQmxvZzogaHR0 cHM6Ly9zdGFyZGl2aW5lci5naXRodWIuaW8vDQogICAgICAgSVJDKGZyZWVub2RlKTogc3RhcmRp dmluZXIsIE1hdHJpeDogc3RhcmRpdmluZXINCiAgICAgICBHUEc6IEYwOUY2NTBEN0Q2NzQ4MTk4 OTI1OTE0MDFCNURGMUM5NUFFODlBQzMNCg== --_004_PAXPR08MB6640F9A31608E3D1A737FCA2A38A9PAXPR08MB6640eurp_--