Subject: bug#58558: 29.0.50; re-search-forward is slow in some buffers

From: Eli Zaretskii <[email-masked]>
Date: Mon, 10 Apr 2023 19:04:35 +0300

> From: Ihor Radchenko <[email-masked]>
> Cc: [email-masked], [email-masked], [email-masked]
> Date: Mon, 10 Apr 2023 14:55:09 +0000
> 
> > I believe perf is capable of showing the number of calls as well?  Can
> > you compare the number of calls between the two versions?
> 
> I can only see
> https://www.brendangregg.com/blog/2014-07-03/perf-counting.html, but it
> appears to be only for built-in events. Do you know how to count calls
> to specific function using perf? I am not familiar at all with perf.

I thought that was part of the profile?

But if not, then maybe Stefan's "poor-man's counters" will be an
easier device for answering that particular question: just increment
it before every call to SYNTAX_TABLE_BYTE_TO_CHAR that you find inside
re_match_2_internal, and then compare the counts with Emacs 28.