Re: Broken autoconf mmap test (was Re: 1.7] BUG - GREP slows to a crawl with large number of matches on a single file)

2009-11-10 Thread Corinna Vinschen
On Nov 9 21:14, Eric Blake wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Corinna Vinschen on 11/9/2009 7:05 AM: This part of the testcase data2 = (char *) malloc (2 * pagesize); if (!data2) return 1; data2 += (pagesize - ((long int) data2 (pagesize

Re: 1.7] BUG - GREP slows to a crawl with large number of matches on a single file

2009-11-09 Thread Corinna Vinschen
On Nov 8 18:41, Jim Reisert AD1C wrote: Corinna, the new grep works super great - thanks! I'm glad to read that, but I only debugged the problem. The Fedora fix was applied by Chris. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project

Re: Broken autoconf mmap test (was Re: 1.7] BUG - GREP slows to a crawl with large number of matches on a single file)

2009-11-09 Thread Corinna Vinschen
On Nov 8 14:07, Charles Wilson wrote: Corinna Vinschen wrote: On Nov 8 14:56, Corinna Vinschen wrote: Btw., the check for mmap in grep's configure file is broken. It tries to mmap to a fixed address formerly allocated via malloc(). This doesn't work on Windows. An autoconf run with a

Re: Broken autoconf mmap test (was Re: 1.7] BUG - GREP slows to a crawl with large number of matches on a single file)

2009-11-09 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Corinna Vinschen on 11/9/2009 4:59 AM: I just found that the latest autoconf *still* has this broken test for mmap, which basically calls data2 = malloc (size); mmap(data2, ...); Why has this test never been fixed? Chuck?

Re: Broken autoconf mmap test (was Re: 1.7] BUG - GREP slows to a crawl with large number of matches on a single file)

2009-11-09 Thread Corinna Vinschen
On Nov 9 05:50, Eric Blake wrote: According to Corinna Vinschen on 11/9/2009 4:59 AM: MAP_FIXED [...] If the specified address cannot be used, mmap() will fail. Because requiring a fixed address for a mapping is less portable, the use of this option is discouraged. It's an

Re: 1.7] BUG - GREP slows to a crawl with large number of matches on a single file

2009-11-09 Thread aputerguy
Corinna writes: I'm glad to read that, but I only debugged the problem. The Fedora fix was applied by Chris. Well it works for me too and as the OP of the problem, I extend my thanks to both of you and all the others who helped in debugging and coming up with such a quick fix. My only

Re: 1.7] BUG - GREP slows to a crawl with large number of matches on a single file

2009-11-09 Thread Corinna Vinschen
On Nov 9 10:22, aputerguy wrote: My only remaining question is can we assume that this bug (or bad coding) is grep-specific or is it likely to rear its head in other core *nix utilities that use UTF-8? Who knows? Nobody is immune against creating bad code, right? Corinna -- Corinna

Re: Broken autoconf mmap test (was Re: 1.7] BUG - GREP slows to a crawl with large number of matches on a single file)

2009-11-09 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Corinna Vinschen on 11/9/2009 7:05 AM: This part of the testcase data2 = (char *) malloc (2 * pagesize); if (!data2) return 1; data2 += (pagesize - ((long int) data2 (pagesize - 1))) (pagesize - 1); if (data2 != mmap

Re: Broken autoconf mmap test (was Re: 1.7] BUG - GREP slows to a crawl with large number of matches on a single file)

2009-11-09 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 [please limit replies about the patch itself to autoconf-patches] According to Corinna Vinschen on 11/9/2009 7:05 AM: This part of the testcase data2 = (char *) malloc (2 * pagesize); if (!data2) return 1; data2 += (pagesize - ((long

Re: 1.7] BUG - GREP slows to a crawl with large number of matches on a single file

2009-11-08 Thread Corinna Vinschen
On Nov 7 15:26, aputerguy wrote: Changing LC_ALL also solved the problem for me. But it begs the question of how many other basic and take-for-granted functions might be affected by this apparent UTF-8 slowdown. And again we, are not talking about some minor overhead, we are talking about a

Re: 1.7] BUG - GREP slows to a crawl with large number of matches on a single file

2009-11-08 Thread Corinna Vinschen
On Nov 8 11:30, Corinna Vinschen wrote: On Nov 7 15:26, aputerguy wrote: Changing LC_ALL also solved the problem for me. But it begs the question of how many other basic and take-for-granted functions might be affected by this apparent UTF-8 slowdown. And again we, are not talking

Broken autoconf mmap test (was Re: 1.7] BUG - GREP slows to a crawl with large number of matches on a single file)

2009-11-08 Thread Corinna Vinschen
On Nov 8 14:56, Corinna Vinschen wrote: Btw., the check for mmap in grep's configure file is broken. It tries to mmap to a fixed address formerly allocated via malloc(). This doesn't work on Windows. An autoconf run with a newer version of autoconf would be nice. I just found that the

Re: Broken autoconf mmap test (was Re: 1.7] BUG - GREP slows to a crawl with large number of matches on a single file)

2009-11-08 Thread Ralph Hempel
Corinna Vinschen wrote: On Nov 8 14:56, Corinna Vinschen wrote: Btw., the check for mmap in grep's configure file is broken. It tries to mmap to a fixed address formerly allocated via malloc(). This doesn't work on Windows. An autoconf run with a newer version of autoconf would be nice. I

Re: Broken autoconf mmap test (was Re: 1.7] BUG - GREP slows to a crawl with large number of matches on a single file)

2009-11-08 Thread Christopher Faylor
On Sun, Nov 08, 2009 at 10:51:56AM -0500, Ralph Hempel wrote: Corinna Vinschen wrote: On Nov 8 14:56, Corinna Vinschen wrote: Btw., the check for mmap in grep's configure file is broken. It tries to mmap to a fixed address formerly allocated via malloc(). This doesn't work on Windows. An

Re: 1.7] BUG - GREP slows to a crawl with large number of matches on a single file

2009-11-08 Thread Yaakov (Cygwin/X)
On 08/11/2009 07:56, Corinna Vinschen wrote: Btw., the check for mmap in grep's configure file is broken. It tries to mmap to a fixed address formerly allocated via malloc(). This doesn't work on Windows. An autoconf run with a newer version of autoconf would be nice. You said the same

Re: 1.7] BUG - GREP slows to a crawl with large number of matches on a single file

2009-11-08 Thread Christopher Faylor
On Sun, Nov 08, 2009 at 12:27:29PM -0600, Yaakov (Cygwin/X) wrote: On 08/11/2009 07:56, Corinna Vinschen wrote: Btw., the check for mmap in grep's configure file is broken. It tries to mmap to a fixed address formerly allocated via malloc(). This doesn't work on Windows. An autoconf run with

Re: Broken autoconf mmap test (was Re: 1.7] BUG - GREP slows to a crawl with large number of matches on a single file)

2009-11-08 Thread Charles Wilson
Corinna Vinschen wrote: On Nov 8 14:56, Corinna Vinschen wrote: Btw., the check for mmap in grep's configure file is broken. It tries to mmap to a fixed address formerly allocated via malloc(). This doesn't work on Windows. An autoconf run with a newer version of autoconf would be nice.

Re: 1.7] BUG - GREP slows to a crawl with large number of matches on a single file

2009-11-08 Thread Jim Reisert AD1C
Corinna, the new grep works super great - thanks! -- Jim Reisert AD1C, jjreis...@alum.mit.edu, http://www.ad1c.us -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info:

Re: 1.7] BUG - GREP slows to a crawl with large number of matches on a single file

2009-11-07 Thread Richard Foulk
Jim Reisert wrote: On Fri, Nov 6, 2009 at 7:12 AM, Cooper, Karl (US SSA) karl.coo...@baesystems.com wrote: Corinna Vinschen wrote: Or try LANG=C.ASCII since LANG=C will still return UTF-8 as charset when calling nl_langinfo(CHARSET). Yes, this solves it: $ time LC_ALL=C.ASCII grep dog

Re: 1.7] BUG - GREP slows to a crawl with large number of matches on a single file

2009-11-07 Thread aputerguy
Changing LC_ALL also solved the problem for me. But it begs the question of how many other basic and take-for-granted functions might be affected by this apparent UTF-8 slowdown. And again we, are not talking about some minor overhead, we are talking about a slowdown of 1500X or 150,000% As

1.7] BUG - GREP slows to a crawl with large number of matches on a single file

2009-11-05 Thread aputerguy
Running grep on a 20MB file with ~100,000 matches takes an incredible almost 8 minutes under Cygwin 1.7 while taking just 0.2 seconds under Cygwin 1.5 (on a 2nd machine). The following cases show how grep under 1.7 grinds to a halt as the number of matches increases. The data 'testfile' is a

Re: 1.7] BUG - GREP slows to a crawl with large number of matches on a single file

2009-11-05 Thread Dave Korn
aputerguy wrote: The data 'testfile' is a plain text file of the acl's of all the 108,000 files on my Windoze computer. So, the find | xargs trick worked then did it? :-) cheers, DaveK -- Problem reports: http://cygwin.com/problems.html FAQ:

Re: 1.7] BUG - GREP slows to a crawl with large number of matches on a single file

2009-11-05 Thread Christopher Faylor
On Thu, Nov 05, 2009 at 03:27:07PM -0800, aputerguy wrote: Running grep on a 20MB file with ~100,000 matches takes an incredible almost 8 minutes under Cygwin 1.7 while taking just 0.2 seconds under Cygwin 1.5 (on a 2nd machine). The following cases show how grep under 1.7 grinds to a halt as

Re: 1.7] BUG - GREP slows to a crawl with large number of matches on a single file

2009-11-05 Thread Linda Walsh
aputerguy wrote: Running grep on a 20MB file with ~100,000 matches takes an incredible almost 8 minutes under Cygwin 1.7 while taking just 0.2 seconds under Cygwin 1.5 (on a 2nd machine). --- I've seen nasty behavior with grep that isnt' cygwin specific. Try pcregrep and see if you have the

Re: 1.7] BUG - GREP slows to a crawl with large number of matches on a single file

2009-11-05 Thread Christopher Faylor
On Thu, Nov 05, 2009 at 07:11:02PM -0800, Linda Walsh wrote: aputerguy wrote: Running grep on a 20MB file with ~100,000 matches takes an incredible almost 8 minutes under Cygwin 1.7 while taking just 0.2 seconds under Cygwin 1.5 (on a 2nd machine). I've seen nasty behavior with grep that isnt'

Re: 1.7] BUG - GREP slows to a crawl with large number of matches on a single file

2009-11-05 Thread aputerguy
OK. Here is a simple test case: X=10 while [ $X -gt 0 ] ; do echo The quick brown fox jumped over the lazy dog ; let X=X-1; done testfile time grep dog testfile | wc Cygwin 1.5: real0m0.219s user0m0.232s sys 0m0.045s Cygwin 1.7: real7m46.575s user7m14.138s sys