emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] add compiled regexp primitive lisp object


From: Ihor Radchenko
Subject: Re: [PATCH] add compiled regexp primitive lisp object
Date: Sun, 22 Dec 2024 20:02:19 +0000

Eli Zaretskii <eliz@gnu.org> writes:

>> See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63225
>> TL;DR: Compiling regexps can take a significant fraction of time when
>> parsing Org documents.
>
> Which fraction?

Close to 10%. See the very first message.

I just repeated my benchmark using
M-: (benchmark-run 1 (org-element-parse-buffer 'object))
on the latest Emacs master (emacs -Q)

    17.77%  emacs         emacs                                  [.] 
re_match_2_internal
     7.98%  emacs         emacs                                  [.] 
re_compile_pattern
     4.70%  emacs         emacs                                  [.] re_search_2
     4.31%  emacs         emacs                                  [.] re_iswctype

> ... That bug has a lot of numbers, but I couldn't find
> any numbers for the percentage of time take by re_compile_pattern and
> friends.  So I guess your conclusion above was based on indirect
> evidence and/or estimations/hunches?

Nope, I did similar profiling.
The further discussion started from there, discussing about regexp
cache, cache misses (that are causing re_compile_pattern to be called
frequently), and ways to improve the performance.

-- 
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>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]