From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,8de7eedad50552f1 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!newshub.sdsu.edu!elnk-nf2-pas!elnk-pas-nf1!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!stamper.news.atl.earthlink.net!newsread3.news.atl.earthlink.net.POSTED!14bb18d8!not-for-mail Sender: mheaney@MHEANEYX200 Newsgroups: comp.lang.ada Subject: Re: Ada bench References: <1112907561.987114.305060@z14g2000cwz.googlegroups.com> <1113851668.905224.87270@l41g2000cwc.googlegroups.com> <1113929009.283051.203460@l41g2000cwc.googlegroups.com> <1113952942.691069.197890@z14g2000cwz.googlegroups.com> From: Matthew Heaney Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 20 Apr 2005 00:49:48 GMT NNTP-Posting-Host: 24.149.57.125 X-Complaints-To: abuse@earthlink.net X-Trace: newsread3.news.atl.earthlink.net 1113958188 24.149.57.125 (Tue, 19 Apr 2005 17:49:48 PDT) NNTP-Posting-Date: Tue, 19 Apr 2005 17:49:48 PDT Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: g2news1.google.com comp.lang.ada:10598 Date: 2005-04-20T00:49:48+00:00 List-Id: "David Sauvage" writes: > - for the GNAT.Spitbol.Table method, i just instantiate the generic > with 40_000 as discriminant (same value as the C spellcheck > implementation) I would also call Reserve_Capacity with a value of 40_000, in both the hashed map and hashed set versions. > - for the AI302.Containers.Indefinite_Hashed_Maps method i used the > default AI302.Strings.Hash as hash function > - When using the Ada.Streams.Stream_IO method, i used a 4_096 buffer. > > GNAT.Spitbol.Table + Ada.Streams.Stream_IO (*1) : 145 > GNAT.Spitbol.Table + Ada.Text_IO : 175 > AI302.Containers.Indefinite_Hashed_Maps + Ada.Streams.Stream_IO : 278 > AI302.Containers.Indefinite_Hashed_Maps + Ada.Text_IO : 310 This is good data. Can you make a version that uses the (indefinite) hashed set too, and post those results? Also, can you post a data set with the new hash function (see below)? > "Matthew Heaney" wrote > > Have you tried using the C++ hash function with an Ada program that > > uses Ada.Containers.Hashed_Maps? > > nop, excellent i will try this soon. Here's the hash function: function Hash_Word (S : String) return Hash_Type is H : Hash_Type := 0; begin for I in S'Range loop H := 5 * H + Character'Pos (S (I)); end loop; return H; end Hash_Word; -Matt