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 ms0.migadu.com with LMTPS id eBZRG1nLkGAGCAAAgWs5BA (envelope-from ) for ; Tue, 04 May 2021 06:19:37 +0200 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 mGTsFlnLkGClfgAAbx9fmQ (envelope-from ) for ; Tue, 04 May 2021 04:19:37 +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 A875236124 for ; Tue, 4 May 2021 06:19:36 +0200 (CEST) Received: from localhost ([::1]:46510 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldmX0-0003B4-3z for larch@yhetil.org; Tue, 04 May 2021 00:19:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41128) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldmWc-0003Aw-6q for emacs-orgmode@gnu.org; Tue, 04 May 2021 00:19:10 -0400 Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]:47015) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ldmWa-0006nL-I3; Tue, 04 May 2021 00:19:09 -0400 Received: by mail-lf1-x12d.google.com with SMTP id 12so11300024lfq.13; Mon, 03 May 2021 21:19:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:in-reply-to:references:cc:date:message-id :mime-version; bh=udfL+DMqEui0bCgRHYngaQBuU+i2ZVAn1ZVyPmN9m+I=; b=Amw8SkK1nE4tobCkJ6YIgdz9C3JYOxuH4pBMQN2PuvDniYA3jpJb90OCeu4eOmVi0w Fla0YX+yXFpxhu+bsRHXo5XDEhECtcIgbYGJtrDlHjhL+L5Gr1uNwbQnBc3WLKkokV8d fqSAZaaM+un4N3jJBFV6s3rDHl73Crowq9MAmryu5qMLMZsI+FdxifJbZSkY1enFU35D /+cn3sYtT13IqFRvz2waiApC5V/M4hsmHEf6UFe+Ds/WJ1zWNNIwqojBbQxtH2q7kTS9 rjEu7GlNlrrBKSHAqyR73efU6x8/CQ9t3/A/sH+MYyJjY1ep2iN99wBitLwMbrLFdpEA prag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:in-reply-to:references:cc:date :message-id:mime-version; bh=udfL+DMqEui0bCgRHYngaQBuU+i2ZVAn1ZVyPmN9m+I=; b=qdC4hB41vKmRUpVc3o8Z2Zm9TCz3Y8j7x2Xps6nbdpWAsitwgcDwNyDaB5BNHd1GDn Cagnm1OOOSw2SCeM9qyzPY0kjv4o2loQwgPNF8ELfBR5LWdX93gDmvlzgCUl2NibHBpn JQwvwLN2hWwm7TVjokapP2Pi0uOJIaUqcZcTZhDHH9PyJlDfnt2+Zp1uRI9AhrzbzgJK FFvZ9+Z7rgVNwilSTOlcckeVTK9/6Cgf++IK4tktjI8C44x/wGKbseXZZd9z4Q5NsfkR b+o38ll463p4JwJtwN7nL56TC/kIqBtoQk2PkmKR661OQsafSp2ljF/Drh8WgpM4mPZK UtHg== X-Gm-Message-State: AOAM531Bnr3qp7yWa1EieCBkY60Vrvp3ayqWdkQin71QRMt92fdA6n2k STp6t4ww8K2eLosry+zJ6uMHIyD5WnYBJpAK X-Google-Smtp-Source: ABdhPJyz7xE+UEChW3F0JNQWvCP12Lbq0GhKNXSBebS87F12uRpbn1TRCWAoCUanICl4IhLCnNsinA== X-Received: by 2002:ac2:53a2:: with SMTP id j2mr16033444lfh.246.1620101945297; Mon, 03 May 2021 21:19:05 -0700 (PDT) Received: from localhost ([158.255.2.9]) by smtp.gmail.com with ESMTPSA id a5sm144264lfg.115.2021.05.03.21.19.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 May 2021 21:19:04 -0700 (PDT) From: Ihor Radchenko To: Bastien Subject: Re: prettify-symbols-mode in org agenda? In-Reply-To: <87k0ofn3er.fsf@gnu.org> References: <87o8kf81yq.fsf@localhost> <87im474fgy.fsf@gnu.org> <87v98263bg.fsf@localhost> <87mtteo6zq.fsf@localhost> <87h7jl1eds.fsf@localhost> <87k0ofn3er.fsf@gnu.org> Date: Tue, 04 May 2021 12:23:02 +0800 Message-ID: <87y2cvyvo9.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a00:1450:4864:20::12d; envelope-from=yantar92@gmail.com; helo=mail-lf1-x12d.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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, 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: , Cc: William Xu , emacs-orgmode@gnu.org 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=1620101976; 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=udfL+DMqEui0bCgRHYngaQBuU+i2ZVAn1ZVyPmN9m+I=; b=Ny7uyPRJSALCC/SIo0ApUsLjpxwScLQB/lhqgQBAjtTFiIDruC4CR1UGE/+d/Ruw0k+bF/ sDNAZQswN0H/rflx/1EBO/z5xi404Prs2UfdobVV8nortm55udswDnsv1JY6Wy90WD7EjX BFm5lFWsc605ZUnFeVtipzAW8Sj8Yf1EDTosdiVwlxAx6/VFEwOA9EKw00vwgkjZeED23/ kqdhT4lcinaQpZLzrzVWO8ptxiogMGUboPtrkT/gBdl0rIAb/Wps4vs4QI+glWczn3TO79 KH9QiuH2L4h9oYW9yoHdYKP/6HbF0obg596iCTDXHUHnSkRiCZtj3n7rl2DGyg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1620101976; a=rsa-sha256; cv=none; b=kF7mchQSf9AR35leg9PMCpIBVX6yk8776bsUCBaS38s1dOiz8pPK0zQwTjJWSQDk/mKXL8 B4XO6Ot2jpuNnHRHFgq7CzMDgSPsRbCYe3YuuJ78GtS50wLW6mFXa9NUuk71BKYaJ2t/3r zZ06KJlbfXswdpS822AL/+KhFSQPQWtkA1LQpvmB6Ui0vrNC1JCaA837NWXE+kkQFI8/6n nJpDwnmTBwG0ZRlyrcKviRuy2IqRZNXz1gW8tCQBLp+33Yh8Iuxy4uf9BIgRxCHAX6cNgW 5kXxOnF7n0IJ0EVU3lBk6m6fZ9aKWJUB3pH8vU7EvcMzNdSAEzweqxtHFoaVRw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=Amw8SkK1; 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: -1.66 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=Amw8SkK1; 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: A875236124 X-Spam-Score: -1.66 X-Migadu-Scanner: scn0.migadu.com X-TUID: fVcPtSxwl0ox Bastien writes: > Could it slow down agenda generation for some configurations? Yes, it can. Specifically, fontifying tags can be costly. For illustration, below if profiler report for a very large agenda buffer (1468 entries): 19820 95% - org-agenda ... 4401 21% - org-agenda-fix-displayed-tags 3711 17% + org-mode ... 1410 6% - org-buffer-substring-fontified 1380 6% + jit-lock-fontify-now (full profiler report at the end of the message) The total slowdown is ~30%, though the second part will only be slow before the headings are fontified first time by org-buffer-substring-fontified. Subsequent agenda rebuilds will be faster. The first part is harder. It is related to tag fontification. Currently, agenda fetches tag list as unfontified strings via org-get-tags. So, I had to re-fontify tags manual is temporary org-mode buffer. You can see that running org-mode in fresh buffer takes a lot of time. Alternative approach would be modifying org-get-tags to return fontified strings, but I am not sure if it is safe to do - unrelated parts of org might be affected. Or I can write something like org-get-tags-fontified. What do you think? Best, Ihor 20147 96% - command-execute 20147 96% - funcall-interactively 19820 95% - org-agenda 19820 95% - apply 19820 95% - ad-Advice-org-agenda 19820 95% - # 19820 95% - apply 19820 95% - # 19761 94% - call-interactively 19761 94% - funcall-interactively 19741 94% - org-todo-list 13331 63% - org-agenda-get-day-entries 13331 63% - apply 13331 63% - # 13331 63% - org-agenda-get-todos 13331 63% - apply 13331 63% - # 8115 38% - org-agenda-format-item 4401 21% - org-agenda-fix-displayed-tags 3711 17% + org-mode 409 1% + font-lock-ensure 161 0% + org-fold-core--fix-folded-region 40 0% + # 3554 17% - eval 3554 17% - format 3554 17% - format 3544 17% - org-eval 3463 16% + yant/format-time-balance-multiplier 81 0% + yant/format-summary-for-agenda 10 0% + if 40 0% replace-regexp-in-string 10 0% org-get-time-of-day 3185 15% - org-get-tags 3095 14% + org-up-heading-safe 20 0% org--get-local-tags 20 0% + org-before-first-heading-p 10 0% + mapcar 10 0% + org-remove-uninherited-tags 1410 6% - org-buffer-substring-fontified 1380 6% + jit-lock-fontify-now 362 1% org-get-priority 39 0% org-add-props 20 0% org-get-todo-state 10 0% org-agenda-skip 10 0% replace-regexp-in-string 9 0% org-agenda-new-marker 5400 25% - org-agenda-finalize 2920 14% + org-get-tags 1380 6% + run-hooks 610 2% org-agenda-fontify-priorities 340 1% + org-agenda-align-tags 30 0% + org-activate-links 20 0% + org-agenda-mark-clocking-task 730 3% + org-agenda-prepare 150 0% + org-agenda-finalize-entries 80 0% + org-fold-core--fix-folded-region 59 0% + org-agenda-get-restriction-and-command