[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org 819409baab 4/7: org-get-buffer-tags: Improve perfor
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org 819409baab 4/7: org-get-buffer-tags: Improve performance |
Date: |
Thu, 9 Jun 2022 04:58:10 -0400 (EDT) |
branch: externals/org
commit 819409baabf5c146d7ef2bf5d63d6714402e12dd
Author: Ihor Radchenko <yantar92@gmail.com>
Commit: Ihor Radchenko <yantar92@gmail.com>
org-get-buffer-tags: Improve performance
* lisp/org.el (org-get-buffer-tags): Use hash table to accumulate
unique tags only. The old approach also used hash tables under the
hood of `delete-dups', but required extra memory allocation to store
the full tag list.
---
lisp/org.el | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/lisp/org.el b/lisp/org.el
index f40131ecb8..1d9246e4ec 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -11812,12 +11812,13 @@ Inherited tags have the `inherited' text property."
(if (org-element--cache-active-p)
;; `org-element-cache-map' is about 2x faster compared to regexp
;; search.
- (let ((tags (org-element-cache-map
- (lambda (el) (org-element-property :tags el)))))
- (mapcar #'list (mapcar #'substring-no-properties
- (delete-dups
- (append org-file-tags
- (apply #'append tags))))))
+ (let ((hashed (make-hash-table :test #'equal)))
+ (org-element-cache-map
+ (lambda (el)
+ (dolist (tag (org-element-property :tags el))
+ (puthash (list tag) t hashed))))
+ (dolist (tag org-file-tags) (puthash (list tag) t hashed))
+ (hash-table-keys hashed))
(org-with-point-at 1
(let (tags)
(while (re-search-forward org-tag-line-re nil t)
- [elpa] externals/org updated (c02c0d660d -> d9963c58dc), ELPA Syncer, 2022/06/09
- [elpa] externals/org 819409baab 4/7: org-get-buffer-tags: Improve performance,
ELPA Syncer <=
- [elpa] externals/org 0e7033e0ca 6/7: org-capture: Expand sexps in template with Org mode being active, ELPA Syncer, 2022/06/09
- [elpa] externals/org d9963c58dc 7/7: lisp/ol.el: Fix shadowed radio targets, ELPA Syncer, 2022/06/09
- [elpa] externals/org 96746438c0 1/7: org-element--cache-find: Do not hash section/org-data/table elements, ELPA Syncer, 2022/06/09
- [elpa] externals/org 46df681336 2/7: org.el: Improve performance of deletion commands, ELPA Syncer, 2022/06/09
- [elpa] externals/org 4487acc630 5/7: org-element-cache: Do not compare buffer positions with cache keys, ELPA Syncer, 2022/06/09
- [elpa] externals/org 93821b431c 3/7: org-element--cache-for-removal: Improve performance, ELPA Syncer, 2022/06/09