This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: new extension: boyer-moore search algorithm variants


On 11/22/06, Benjamin Kosnik <bkoz@redhat.com> wrote:

> > I have two questions about this patch. > > > > 1) struct __bm_struct. > > > > Boo. Bad name. How about __boyer_moore_base? Other ideas? > > Yes, sure thing, maybe vm_area_struct has had it's toll on me ;-)

;)

Just going for clarity here....

Ok, changed the name.



> > 2) Why __is_one_byte and not moving __is_char from > > ext/cpp_type_traits.h and correcting it for signed/unsigned.... > > As already mentioned by Paolo, we need the type to be a one byte type, > because we are using table lookup of 256(actually 384) entries, which > happens to be the domain of POD+one byte types. And this table is > indexed by the character's ASCII value. This special use case is a > peculiarity of the algorithm under question.

See the followups to this.

As mentioned by Paolo, I have used a combination of std::tr1::is_integral<> and sizeof() == 1.


> > Can you add in the testsuite additions? > > Yes, one niggling question though. I need to add a data file too. > Where should that go?

Sure.

That should go in:
gcc/libstdc++-v3/testsuite/data/

Ok, added.




> Plus, there should be two separate cases. One that checks the return > value of boyer moore against std::search() for regressions, and one > that checks for performance.

Ok.

The regression tests should go in:
gcc/libstdc++-v3/testsuite/ext
(or maybe a subdirectory if there are more than one)

And the performance tests should go in:

gcc/libstdc++-v3/testsuite/performance/ext
(same subdir thing)


Ok, the thing is that for the perf. test cases, I am passing different -D options to change the search string, and the algorithm used. Currently, there are 4 algorithms, and 7 different types search strings, giving rise to 4*7==28 different perf. tests. So, is there a way to compile the same file with a different -D option for like 28 times????

I kinda don't know how to modify the makefiles, so any help in that
area would be much appreciated too. :-)


Attached is the new patch along with the data file.


Regards,
-Dhruv.

--
  -Dhruv Matani.
http://www.geocities.com/dhruvbird/

"Be sure brain is in gear before engaging mouth"
     -- Anonymous

Attachment: patch.boyer_moore.dhruv.tar.bz2
Description: BZip2 compressed data


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