Subject: Re: text-index (was: bug#77924: 31.0.50; [Feature branch] Change marker implementation)

From: Ihor Radchenko <[email-masked]>
Date: Sun, 27 Apr 2025 18:23:42 +0000

Stefan Monnier <[email-masked]> writes:

> Could you try out the performance of the `scratch/text-index` branch on
> your famous Org test case(s) that has historically suffered from poor
> markers performance?
> [ And maybe report the result to bug#77924?  ]

I did re-search-forward benchmark on a large multi-language Org file.

;; master
;; (23.0212253 0 0.0)
;; (22.53031908 0 0.0)

;; scratch/text-index branch
;; (22.993521733999998 0 0.0)
;; (25.580392903 0 0.0)

Overall, I see little difference in performance.

The benchmark:

(setq yant/re "\\(?:\\(?:\\<DEADLINE: *\\(\\(?:<\\(?:[[:digit:]]\\{4\\}-[[:digit:]]\\{2\\}-[[:digit:]]\\{2\\}\\(?: [[:alpha:]]+\\)?\\)\\(?: [[:digit:]]\\{1,2\\}:[[:digit:]]\\{2\\}\\(?:-[[:digit:]]\\{1,2\\}:[[:digit:]]\\{2\\}\\)?\\)?\\(?:\\(?: [+.:-]\\{1,2\\}[[:digit:]]+[dhmwy]\\(?:/[[:digit:]]+[dhmwy]\\)?\\)\\{1,2\\}\\)?>\\)\\)\\)\\|\\(?:\\(?:<\\(?:[[:digit:]]\\{4\\}-[[:digit:]]\\{2\\}-[[:digit:]]\\{2\\}\\(?: [[:alpha:]]+\\)?\\)\\(?: [[:digit:]]\\{1,2\\}:[[:digit:]]\\{2\\}\\(?:-[[:digit:]]\\{1,2\\}:[[:digit:]]\\{2\\}\\)?\\)?\\(?:\\(?: [+.:-]\\{1,2\\}[[:digit:]]+[dhmwy]\\(?:/[[:digit:]]+[dhmwy]\\)?\\)\\{1,2\\}\\)?>\\)\\|^\\*+[[:blank:]]+\\(?:[[:upper:]]+[[:blank:]]+\\)?\\[#A]\\|^[[:space:]]*:STYLE:[[:space:]]+habit[[:space:]]*$\\)\\)")
(benchmark-run 20 (goto-char (point-min)) (while (re-search-forward yant/re nil t)))

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>