[PATCH] improve regex performance

Isamu Hasegawa isamu@yamato.ibm.com
Tue Jun 26 21:15:00 GMT 2001


Hello,

Subject: Re: [PATCH] improve regex performance
From: Ulrich Drepper <drepper@redhat.com>
Date: 25 Jun 2001 17:05:01 -0700
Message-ID: < m3hex4kswi.fsf@otr.mynet >
> Take a look at the posix/tst-regex.c program.  It's currently not
  [snip]
> produce any output.  Either the code is ***really*** slow and it'll
> get there eventually or the regexec() function is caught in an endless
> loop.


This is an interim report since it seems that there are still problems.

I think the problem may be caused by the performance of the wcs version.
Because very large texts were difficult for the wcs version to deal with.

1st patch is for optimization of count_mbs_length() by binary search,
and 2nd patch is the same as the last patch I sent.
(1st patch is against for revision 1.100, and 2nd patch is against for
 the one after applied 1st patch.)

When I built like...

gcc -nostdlib -nostartfiles -o tst-regex  -Wl,-dynamic-linker=/lib/ld-linux.so.2   ../csu/crt1.o ../csu/crti.o `gcc --print-file-name=crtbegin.o` tst-regex.o -Wl,-rpath-link=..:../math:../elf:../dlfcn:../nss:../nis:../rt:../resolv:../crypt:../linuxthreads ../libc.so.6 ../libc_nonshared.a -lgcc `gcc --print-file-name=crtend.o` ../csu/crtn.o regex.o
                          ^^^^^^^

tst-regex finished in reasonable time.
(However I ad-hoc modified __wctype and __btowc to wctype and btowc in
 regex.c.)

However when I built without regex.o like...

gcc -nostdlib -nostartfiles -o tst-regex  -Wl,-dynamic-linker=/lib/ld-linux.so.2   ../csu/crt1.o ../csu/crti.o `gcc --print-file-name=crtbegin.o` tst-regex.o -Wl,-rpath-link=..:../math:../elf:../dlfcn:../nss:../nis:../rt:../resolv:../crypt:../linuxthreads ../libc.so.6 ../libc_nonshared.a -lgcc `gcc --print-file-name=crtend.o` ../csu/crtn.o

tst-regex froze during "Test with 8-bit locale"...

I'm still working on this problem.
But perhaps it might be just my misunderstanding,
so I send patches as an interim report.

Thanks,
-- 
Isamu Hasegawa
IBM Japan, Ltd.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.1.gz
Type: application/x-gzip
Size: 786 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20010626/918da9fc/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.2.gz
Type: application/x-gzip
Size: 2800 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20010626/918da9fc/attachment-0001.bin>


More information about the Libc-alpha mailing list