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!postnews.google.com!l41g2000cwc.googlegroups.com!not-for-mail From: "Matthew Heaney" Newsgroups: comp.lang.ada Subject: Re: Ada bench Date: 19 Apr 2005 09:43:29 -0700 Organization: http://groups.google.com Message-ID: <1113929009.283051.203460@l41g2000cwc.googlegroups.com> References: <1112907561.987114.305060@z14g2000cwz.googlegroups.com> <1113851668.905224.87270@l41g2000cwc.googlegroups.com> NNTP-Posting-Host: 66.162.65.162 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1113929013 31691 127.0.0.1 (19 Apr 2005 16:43:33 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 19 Apr 2005 16:43:33 +0000 (UTC) In-Reply-To: <1113851668.905224.87270@l41g2000cwc.googlegroups.com> User-Agent: G2/0.2 Complaints-To: groups-abuse@google.com Injection-Info: l41g2000cwc.googlegroups.com; posting-host=66.162.65.162; posting-account=Zl1UPAwAAADEsUSm1PMMiDjihtBlZUi_ Xref: g2news1.google.com comp.lang.ada:10575 Date: 2005-04-19T09:43:29-07:00 List-Id: David Sauvage wrote: > > I've proposed a new spellcheck version without using the AI-302 > Containers, i've used GNAT.Spitbol.Table. The app is twice faster. I > also used Ada.Streams.Stream_IO.Read. How do you know from where the improvement came -- the change in data structure or the change in read mechanism? Also, what hash function have you been using? I just compared Ada.Strings.Hash to the hash function used in the C++ example, and the C++ hash function does much better on the words in spellcheck-dict.txt. Have you tried using the C++ hash function with an Ada program that uses Ada.Containers.Hashed_Maps? Note that strictly speaking, you don't need to use the hashed map, since the shootout is comparing "hash tables." In the standard library, there are two kinds of hash tables, hashed maps and hashed sets. In the shootout spellcheck example, you only need a membership test, so a hashed set will do just as well. (Probably better, in fact.) -Matt