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,ad4585f2971e47c5 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Path: g2news2.google.com!news3.google.com!feeder.news-service.com!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!news.weisnix.org!newsfeed.ision.net!newsfeed2.easynews.net!ision!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Sat, 19 Feb 2011 00:58:24 +0100 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.14) Gecko/20110123 Thunderbird/3.1.8 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Need some light on using Ada or not References: <4d5ef836$0$23753$14726298@news.sunsite.dk> In-Reply-To: <4d5ef836$0$23753$14726298@news.sunsite.dk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Message-ID: <4d5f079f$0$6990$9b4e6d93@newsspool4.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 19 Feb 2011 00:58:23 CET NNTP-Posting-Host: e568ecad.newsspool4.arcor-online.net X-Trace: DXC=n;e\>kLeWSnf1oJaJ0@dmg4IUKejVh:UDU\RNeVLi^fmnVAEBeMa X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:18410 Date: 2011-02-19T00:58:23+01:00 List-Id: On 2/18/11 11:52 PM, Luis P. Mendes wrote: > I have some questions, however, that I'd like to be answered: > 1. If Ada is more type safe and restricted than C++, how can it be > significantly slower? > Please see: http://shootout.alioth.debian.org/u64q/benchmark.php? > test=all&lang=gnat > where for some tests, Ada is 2x, 3x, 4x and 5x slower. I happen to know the details of the 3x case (and mention for the record that there are 6 more Ada programs running at ±1x). The 3x program, regex-dna, has two parts: string search and string replacement. The string search part is among the fastest of the shootout programs. The replacement part is slow (even though there seem to have been improvements in the GNAT library recently, I think). The reason is that the pattern matching library used depends on Ada.Strings.Unbounded. Replacements change the string. That differs from typical regex libraries, such as Python's, which constructs new strings under the hood. Consequently, the replacement part of regex-dna accounts for the 3x. (The test rules say that we should use exactly one library, If we could use GNAT's Spitbol patterns for searching and one of the other pattern matching packages for replacement, the Ada program would be closer to the top of the list. The second part of the program would be shorter, too.) I'm saying this in order put the speed argument in perspective. In fact, the shootout has some Ada programs that demonstrate how to get high speed executables from nothing but standard Ada. No tricks, no compiler built-ins. > 3. Is there any kind of fast xml stream parser library? No DOM or SAX, > just to read attributes. Raincode once published their XML parsing library which, IIRC, was for constructing efficient "low level" XML parsers.