From owner-freebsd-bugs@FreeBSD.ORG Sat Sep 4 10:50:27 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B17F116A4CE for ; Sat, 4 Sep 2004 10:50:27 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id A202643D1D for ; Sat, 4 Sep 2004 10:50:27 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id i84AoRV8088744 for ; Sat, 4 Sep 2004 10:50:27 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i84AoRp3088737; Sat, 4 Sep 2004 10:50:27 GMT (envelope-from gnats) Date: Sat, 4 Sep 2004 10:50:27 GMT Message-Id: <200409041050.i84AoRp3088737@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Tim Robbins Subject: Re: bin/71367: regex multibyte support is really slow X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Tim Robbins List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Sep 2004 10:50:27 -0000 The following reply was made to PR bin/71367; it has been noted by GNATS. From: Tim Robbins To: Kuang-che Wu Cc: bug-followup@freebsd.org Subject: Re: bin/71367: regex multibyte support is really slow Date: Sat, 4 Sep 2004 20:49:07 +1000 On Sat, Sep 04, 2004 at 05:39:33PM +0800, Kuang-che Wu wrote: > >How-To-Repeat: > $ cc -O -pipe re.c -o re > $ time ./re > 7.65 real 7.51 user 0.06 sys > > #include > #include > #include > > int main(void) > { > regex_t re; > char string[1024]={ > #define WORD 0xe6,0x85,0xa2 /* UTF-8 character */ > WORD, WORD, WORD, WORD, WORD, WORD, WORD, WORD, WORD, WORD, > WORD, WORD, WORD, WORD, WORD, WORD, WORD, WORD, WORD, WORD, > 0 > }; > > if(setlocale(LC_CTYPE,"zh_TW.UTF-8")==NULL) > return 1; > > if(regcomp(&re,"[[:alnum:]]",REG_EXTENDED|REG_ICASE)!=0) > return 2; > if(regexec(&re,string,0,NULL,0)==0) > printf("matched\n"); > > return 0; > } I can't reproduce these results. I get: $ gcc -O -pipe re.c -o re $ time ./re real 0m0.003s user 0m0.000s sys 0m0.002s CPU: AMD Athlon(tm) 64 Processor 3000+ (2002.58-MHz K8-class CPU) Do you have any non-standard options in /etc/make.conf? Have you changed the C library at all locally? Can you confirm that the system you ran this on was idle? Tim