Gnus development mailing list
 help / color / mirror / Atom feed
From: Felix Lee <flee@teleport.com>
Cc: ding@gnus.org
Subject: Re: Scoring is horribly slowed down by this entry. Why?
Date: Sat, 31 Jul 1999 16:12:31 -0700	[thread overview]
Message-ID: <199907312312.TAA07594@sclp3.sclp.com> (raw)
In-Reply-To: <87d7x8v3pn.fsf@cs.tu-berlin.de> on 01 Aug 1999 00:45:08 +0200.

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.

try using this instead:
  "[-_0-9A-Za-z.]+\.\\(com\\|net\\) *$"
--


  reply	other threads:[~1999-07-31 23:12 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 [this message]
1999-07-31 23:28   ` Felix Lee
1999-08-02 23:36   ` Rui Zhu

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=199907312312.TAA07594@sclp3.sclp.com \
    --to=flee@teleport.com \
    --cc=ding@gnus.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.
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).