From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/24577 Path: main.gmane.org!not-for-mail From: Rui Zhu Newsgroups: gmane.emacs.gnus.general Subject: Re: Scoring is horribly slowed down by this entry. Why? Date: 03 Aug 1999 01:36:37 +0200 Sender: owner-ding@hpc.uh.edu Message-ID: <87n1w9n4ai.fsf@cs.tu-berlin.de> References: <199907312312.TAA07594@sclp3.sclp.com> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035162119 9449 80.91.224.250 (21 Oct 2002 01:01:59 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 01:01:59 +0000 (UTC) Return-Path: Original-Received: from farabi.math.uh.edu (farabi.math.uh.edu [129.7.128.57]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id TAA12053 for ; Mon, 2 Aug 1999 19:39:51 -0400 (EDT) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by farabi.math.uh.edu (8.9.3/8.9.3) with ESMTP id SAB11117; Mon, 2 Aug 1999 18:39:19 -0500 (CDT) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Mon, 02 Aug 1999 18:39:42 -0500 (CDT) Original-Received: from sclp3.sclp.com (root@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id SAA28656 for ; Mon, 2 Aug 1999 18:39:32 -0500 (CDT) Original-Received: from mail.cs.tu-berlin.de (root@mail.cs.tu-berlin.de [130.149.17.13]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id TAA11957 for ; Mon, 2 Aug 1999 19:36:56 -0400 (EDT) Original-Received: from monoid (mail@130-149-145-52.dialup.cs.tu-berlin.de [130.149.145.52]) by mail.cs.tu-berlin.de (8.9.1/8.9.1) with ESMTP id BAA28889 for ; Tue, 3 Aug 1999 01:35:18 +0200 (MET DST) Original-Received: from zhurui by monoid with local (Exim 2.05 #1 (Debian)) id 11BRdJ-0000kq-00; Tue, 3 Aug 1999 01:36:41 +0200 Original-To: ding@gnus.org Original-Lines: 24 User-Agent: Gnus/5.070095 (Pterodactyl Gnus v0.95) Emacs/20.3 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:24577 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:24577 Felix Lee writes: > Rui Zhu : > > ("\\([-_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