From: Rui Zhu <sprache@iname.com>
Subject: Re: Scoring is horribly slowed down by this entry. Why?
Date: 03 Aug 1999 01:36:37 +0200 [thread overview]
Message-ID: <87n1w9n4ai.fsf@cs.tu-berlin.de> (raw)
In-Reply-To: <199907312312.TAA07594@sclp3.sclp.com>
Felix Lee <flee@teleport.com> writes:
> Rui Zhu <sprache@iname.com>:
> > ("\\([-_0-9A-Za-z]+\.\\)+\\(com\\|net\\) *$" -1000 nil r)
>
> 1. there are N possible starting points for the [...]+
> pattern, and greedy-match semantics will have it doing N
> attempts for each possible starting point. the (...)+
> pattern around it forces each of these N attempts to be done
> N times, so the best case performance is something like
> O(N**3). this is going to be terrible, because N is pretty
> large, since alphanumeric characters are common.
>
> 2. "\." should be "\\.". "\." == ".", which makes the
> regexp behavior worse, since it will need to try matching
> any character, not just alphanumerics, which makes N bigger,
> sort of.
Oops, how silly am I. I really want `\\.', it is this forgotten
backslash that causes almost the whole trouble.
Thanks,
Rui
prev parent reply other threads:[~1999-08-02 23:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-07-31 22:45 Rui Zhu
1999-07-31 23:12 ` Felix Lee
1999-07-31 23:28 ` Felix Lee
1999-08-02 23:36 ` Rui Zhu [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=87n1w9n4ai.fsf@cs.tu-berlin.de \
--to=sprache@iname.com \
/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.
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 NNTP newsgroup(s).