all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Thomas Lord <lord@emf.net>
To: rms@gnu.org
Cc: ami@fischman.org, Stefan Monnier <monnier@IRO.UMontreal.CA>,
	emacs-devel@gnu.org
Subject: Re: performance/hang bug in regex.c
Date: Tue, 02 Sep 2008 20:48:52 -0700	[thread overview]
Message-ID: <48BE0924.3090100@emf.net> (raw)
In-Reply-To: <E1KaiJE-000508-8I@fencepost.gnu.org>

Richard M. Stallman wrote:
>     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.
>   

You can probably clean up Rx (found in GNU Arch) well
enough to fix all of those problems although the work of
doing so will require the worker to understand regexp
stuff deeply  (not much (but some) beyond undergrad courses
about DFAs, NFAs and all that but you have to be really
into it -- it's a fairly involved application of that stuff).

-t






>
>
>   





      reply	other threads:[~2008-09-03  3:48 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
2008-09-03  3:48     ` Thomas Lord [this message]

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=48BE0924.3090100@emf.net \
    --to=lord@emf.net \
    --cc=ami@fischman.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@IRO.UMontreal.CA \
    --cc=rms@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.