From: "Richard M. Stallman" <rms@gnu.org>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: ami@fischman.org, emacs-devel@gnu.org
Subject: Re: performance/hang bug in regex.c
Date: Tue, 02 Sep 2008 22:41:28 -0400 [thread overview]
Message-ID: <E1KaiJE-000508-8I@fencepost.gnu.org> (raw)
In-Reply-To: <jwvzlmqz4ae.fsf-monnier+emacs@gnu.org> (message from Stefan Monnier on Tue, 02 Sep 2008 16:26:23 -0400)
Regexps can be implemented in mainly 2 ways: backtracking or not.
If you don't do backtracking, the above problem doesn't occur.
But many/most regexp implementations use a backtracking algorithm
because it's almost indispensable in order to handle backreferences.
Emacs provides backreferences and doesn't bother to provide 2 regexp
implementations (a backtracking one for regexps with backrefs and
a non-backtracking one for all the others), so you get pathological
behaviors for regexps such as the one above. It's too bad, and I hope
we can fix it at some point, but don't hold your breath,
This comes up often enough that maybe it should be explained in one
of the manuals.
next prev parent reply other threads:[~2008-09-03 2:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-02 5:53 performance/hang bug in regex.c Ami Fischman
2008-09-02 20:26 ` Stefan Monnier
2008-09-03 2:41 ` Richard M. Stallman [this message]
2008-09-03 3:48 ` Thomas Lord
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1KaiJE-000508-8I@fencepost.gnu.org \
--to=rms@gnu.org \
--cc=ami@fischman.org \
--cc=emacs-devel@gnu.org \
--cc=monnier@IRO.UMontreal.CA \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).