From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id +FLBOUOxm2FxgQAAgWs5BA (envelope-from ) for ; Mon, 22 Nov 2021 16:03:31 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 2GeKNUOxm2FDXwAAB5/wlQ (envelope-from ) for ; Mon, 22 Nov 2021 15:03:31 +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 6E20923B04 for ; Mon, 22 Nov 2021 16:03:31 +0100 (CET) Received: from localhost ([::1]:44212 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mpAqt-0005f4-1y for larch@yhetil.org; Mon, 22 Nov 2021 10:03:29 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39732) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mpAot-00049j-AM for emacs-orgmode@gnu.org; Mon, 22 Nov 2021 10:01:23 -0500 Received: from [2a00:1450:4864:20::52f] (port=34602 helo=mail-ed1-x52f.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mpAor-0008G7-C1 for emacs-orgmode@gnu.org; Mon, 22 Nov 2021 10:01:23 -0500 Received: by mail-ed1-x52f.google.com with SMTP id x15so78008929edv.1 for ; Mon, 22 Nov 2021 07:01:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=xNBsIgZS138VYE4XrPU+Q9aP4uz7nwODmb56olGMLj0=; b=Jq+1Xvq/JVAvjJt9dVoOybBhjZ6t9NcKQR6Q54vi6mmxDiJMprqLHKJ4pQeRF7PUC/ P4up2vB6NQ9c2NB14yYGNu5UL569eSjQpWNRrpTEVDfT+QVn3q79k/mwVzigrqcJJo+8 msBnYMPrut6PE3cetSJMMl7r0HXvEJZ8eboL2ycJczMX5F/vZvgO8UIrjdEQxi3SJNmL +XhAL5N8qEupdr+JKoXhwTN0yDppPaAhKQi3pd/WQZ+U8SEj7Ep8ahfWXpzU+liqV7SC sAT5EYzZrmlGcsnIdilKkZFA+1UklVqsOTNBTUJg749b7SGMrmeb5ClwHiu7u8V3tvxo LCkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=xNBsIgZS138VYE4XrPU+Q9aP4uz7nwODmb56olGMLj0=; b=BhTPD+k7pwsvyM+TnR7nWyHpzBm67F9k9PAdrkbilRNUzTg2Odt5eKvS2kOUYgNyAV uhHRR/O9Rv+U2DjrLqmAa2XO4TGdlORtHYtBHOHbtDiMQMI+wfWnD8AvcgdciomVKy4c 2d9lzzvY4JJ92y4kyxDB/j1VNa6cZ1lGrsux89pxTlg+mQr6qzxYXv9rJjBWBH++1bXI hcjxS3A0Zv9VVBrmjk7WifkK4+vm6QLPiAO0cjDShiXKKKbBMJR+NYm0maWesLPgOVZ3 ZVsmbgBwuWDYoKDGNBgB7NgBd8orf711I/TCQGPi8Ecb/gl4os2apf/Ot62/vBUxN5Ng BTCw== X-Gm-Message-State: AOAM5317nGKeyeaMLkykbxTBaEKtVxxw8lEVJo+iEIo+I5L3siPuM47y krJpVmGzPpPcvIsVehW9VyGDdMjispMaPsfu X-Google-Smtp-Source: ABdhPJyPXhnvfIIxADUS0DLu2td5T4EpYGcr1Bl1etG1cLUD22ys8CudrX46LHe6VLv3AehrS32rPg== X-Received: by 2002:a05:6402:4407:: with SMTP id y7mr66583383eda.140.1637593271015; Mon, 22 Nov 2021 07:01:11 -0800 (PST) Received: from localhost ([158.255.2.9]) by smtp.gmail.com with ESMTPSA id e15sm4214756edq.46.2021.11.22.07.01.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Nov 2021 07:01:10 -0800 (PST) From: Ihor Radchenko To: Anders Johansson Subject: Re: [BUG?] Cache: org-scan-tags behaves differently on inlinetasks with and without cache In-Reply-To: References: <87ilwkpgmq.fsf@localhost> Date: Mon, 22 Nov 2021 23:02:35 +0800 Message-ID: <87sfvofd2s.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::52f (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::52f; envelope-from=yantar92@gmail.com; helo=mail-ed1-x52f.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Cc: org-mode-email Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1637593411; 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=xNBsIgZS138VYE4XrPU+Q9aP4uz7nwODmb56olGMLj0=; b=uvkdmF5QPJDURUavb5t2uD7ht1uqKALSZ+ysnArni6/odZesoTJCYBRoA+ccNtv2jBvxEu 8IJdvpHSuaWOkaVJQrZzjDqFKEEHLObra6rUmmGNZMxVltCjqTKGuW/qvrRDAVXR6ioG/q wSOgguKI2JD1mK3EoA0H0dN3ssnuyd7U1pBms5soQxnvwnF/Jw2NmFpkLeuCvVtu2jFMiv 1rtf8ogjdr/3UxJW1Ad4pyqq6SW9d4WlG1hUkNUx6Quu+PAErNW0m/5hvtbQemSJXA5O69 e/8I2ATm2CLD1AS6cOp9tmbUP/IRtiAbZ6BpDrAge3/uNKfTmUzbGx2cUmrDLg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1637593411; a=rsa-sha256; cv=none; b=J6BE2EeFh/mwUv3l2Xw5+4+6G/hEVq65+AZ46THXtPm5rOw7xXFzT5zSy8FeOvza5djM2f hvCxr/3l+BP5/YVkfLQ2UeOqbCfbvPvUNnwAVW6eYhDCltwsxFyVnibqGWCHJQjWejGiHi dtuvE8ZKeZD/PmpwBThSlUmJhd0eDbFJyhPB4IcDEMLQMvA6HxFK+VVdmtdswurBcJB4Yx T6ZEUUpf3DaVGzQH9RvqMuOdlk/4svYriMGgb49d4Ul4RU8aYVBXmL4qFJqRZI6phv5hgx w03exmz1Uo/98nQHdJQwTlIIFOTFwsNkrI5ET04nmTScBaHd6Dtj4vzFiqC9jg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="Jq+1Xvq/"; dmarc=pass (policy=none) header.from=gmail.com; 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-Spam-Score: -3.58 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="Jq+1Xvq/"; dmarc=pass (policy=none) header.from=gmail.com; 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: 6E20923B04 X-Spam-Score: -3.58 X-Migadu-Scanner: scn1.migadu.com X-TUID: /BEhbGyAILyJ Anders Johansson writes: > I had considered to implement some kind of cache in my code, but now I > get this "for free"! I originally didn't use org-scan-tags but some > custom and "simpler" code for scanning, but I am glad I refactored to > use org-scan-tags, because now I get this speedup without a single > code change in orgqda. You can achieve even better speedup if you directly use org-element-cache-map with :next-re/:fail-re parameters. If you are matching against specific tags, those tags can be used to create a regexp to locate match candidates very quickly. Beware that org-element-cache-map does not work without org-element-use-cache set to t (it is, by default). Best, Ihor