From: "Mattias Engdegård" <mattiase@acm.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Yuan Fu <casouri@gmail.com>, emacs-devel@gnu.org
Subject: Re: Matching regex case-sensitively in C strings?
Date: Wed, 9 Nov 2022 11:33:09 +0100 [thread overview]
Message-ID: <4FB7E922-5E36-4E0C-9681-9EC0E719CC8D@acm.org> (raw)
In-Reply-To: <838rklxmnm.fsf@gnu.org>
8 nov. 2022 kl. 20.37 skrev Eli Zaretskii <eliz@gnu.org>:
> Please don't call this "translate_table", as it isn't. The
> documentation elsewhere calls this "canonicalize_table" or just
> "canonicalize".
Agreed.
>> fast_c_string_match_ignore_case (Lisp_Object regexp,
>> const char *string, ptrdiff_t len)
>> {
>> + return fast_c_string_match (regexp, string, len, true);
>> +}
>
> I'm bothered that this function, which is supposed to be fast, will
> now be slower due to an extra function call.
You are right to worry about it, but there is actually no need for concern here: it's a tail call (and the extra argument is last) so it should compile to an unconditional jump (and setting a register). You would be hard-pressed to measure the "cost" even if you looked at cycle counters.
next prev parent reply other threads:[~2022-11-09 10:33 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-07 5:41 Matching regex case-sensitively in C strings? Yuan Fu
2022-11-07 11:52 ` Eli Zaretskii
2022-11-07 20:35 ` Yuan Fu
2022-11-08 10:18 ` Mattias Engdegård
2022-11-08 12:29 ` Eli Zaretskii
2022-11-08 19:31 ` Yuan Fu
2022-11-08 19:37 ` Eli Zaretskii
2022-11-08 20:59 ` Yuan Fu
2022-11-09 10:53 ` Mattias Engdegård
2022-11-09 10:33 ` Mattias Engdegård [this message]
2022-11-09 13:06 ` Eli Zaretskii
2022-11-10 9:52 ` Mattias Engdegård
2022-11-10 11:18 ` Eli Zaretskii
2022-11-10 11:35 ` Robert Pluim
2022-11-10 14:20 ` Mattias Engdegård
2022-11-10 22:25 ` Yuan Fu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FB7E922-5E36-4E0C-9681-9EC0E719CC8D@acm.org \
--to=mattiase@acm.org \
--cc=casouri@gmail.com \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.