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,23c85e456e18d6b5 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed01.chello.at!newsfeed02.chello.at!news.hispeed.ch.POSTED!not-for-mail Message-ID: <5221419.vt3xd4rotE@linux1.krischik.com> From: Martin Krischik Subject: Re: The Computer Language Shootout Benchmarks Newsgroups: comp.lang.ada Date: Thu, 04 May 2006 18:48:04 +0200 References: <1262902.DI8C0e8O9o@linux1.krischik.com> <1146595198.437109.277820@u72g2000cwu.googlegroups.com> <1706825.Rr4F3nhIbP@linux1.krischik.com> User-Agent: KNode/0.10.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Complaints-To: abuse@hispeed.ch Organization: hispeed.ch NNTP-Posting-Host: 80.218.119.160 (80.218.119.160) NNTP-Posting-Date: Thu, 04 May 2006 19:15:04 +0200 X-Trace: 02237445a3698f57fd20511729 Xref: g2news2.google.com comp.lang.ada:4067 Date: 2006-05-04T18:48:04+02:00 List-Id: Martin Krischik wrote: > jimmaureenrogers@worldnet.att.net wrote: > >> >> Martin Krischik wrote: >>> Hello >>> >>> Ada is currently missing 2 programs on the "The Computer Language >>> Shootout Benchmarks" [1]. >>> >>> I would not mind having a go. But before I start: >>> >>> One test [2] needs a hash table implementation. The compiler used has >>> no Ada 2005 features so one need to add the implementation to the code >>> itself. Anybody can got a stand alone implementation? Or knows which >>> collections class lib could easily been torn apart? >>> >>> The other test [3] needs some Unbounded_Integer / BigInt etc. type. We >>> could bind to gmp - but I don't like the idea if pragma Import in the >>> code. >> >> This is precisely why I have not found the motivation to complete those >> two benchmarks. > > And somehow I feel that one of those tests has been make to make debians > hash tables for C shine. > > Also C cheats: > > 1) Thy don't check for ">THREE" as demanded but only for ">TH" making up > for a propper string compare. I think that Ada won't need that > > 2) They use a dynamicly growing buffer with an initial size large enough > to hold the hole dateset. This we can dupplicate using the old recursive > string concaternation with an initial string size just as big as C's so it > never goes into recursion. Current timing for Ada looks quite ok: ++ ./knucleotide real 0m0.251s user 0m0.184s sys 0m0.024s ++ ./KNucleotide_1 real 0m0.359s user 0m0.288s sys 0m0.004s ++ ./KNucleotide_2 real 0m0.299s user 0m0.240s sys 0m0.008s First is gcc c - as I have not got the same setup as the shootout I use the c version to compare myself against. The other two are two different version of Ada. Both are not finished and missing freeing heap memory. Interestingly enough the two version allmost identical - In the 2nd version I just rearraged the package/procedure hierarchy using a package local to a procedure for the main work. I did this because I wanted to experiment with region based storrage (not implemented yet) and this theems is consistently faster. Want a sneed preview, here you find the code: http://svn.sourceforge.net/viewcvs.py/wikibook-ada/trunk/demos/Source/Language_Shootout/ There is only one problem: LOC rating is terrible, worse there is. Martin -- mailto://krischik@users.sourceforge.net Ada programming at: http://ada.krischik.com