This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [PATCH] improve regex performance


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.

patch.1.gz

patch.2.gz


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]