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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,703c4f68db81387d X-Google-Thread: 115aec,703c4f68db81387d X-Google-Attributes: gid103376,gid115aec,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!o13g2000cwo.googlegroups.com!not-for-mail From: "fabio de francesco" Newsgroups: comp.lang.ada,comp.realtime Subject: Re: 10 rules for benchmarking (was Re: Teaching new tricks to an old dog (C++ -->Ada)) Date: 13 Mar 2005 01:01:03 -0800 Organization: http://groups.google.com Message-ID: <1110704463.049756.258220@o13g2000cwo.googlegroups.com> References: <395uqaF5rhu2mU1@individual.net> <112rs0bdr2aftdf@corp.supernews.com> <1inxxr988rxgg$.1w9dedak41k89.dlg@40tude.net> <112s1r0rf0o8nca@corp.supernews.com> <112sonip5v4dca6@corp.supernews.com> <112t3de6fu04f38@corp.supernews.com> <1110396477.596174.285520@o13g2000cwo.googlegroups.com> <112vb2t8eonuhed@corp.supernews.com> <1110422108.925127.54110@o13g2000cwo.googlegroups.com> <11329cb96h2p19f@corp.supernews.com> <113394jjvppao64@corp.supernews.com> <1133s3qnmqmbjfb@corp.supernews.com> <4232a9f7$0$26552$9b4e6d93@newsread4.arcor-online.net> <11369p5jrcc6835@corp.supernews.com> <1137falp86qhk89@corp.supernews.com> NNTP-Posting-Host: 82.49.51.180 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1110704467 8848 127.0.0.1 (13 Mar 2005 09:01:07 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 13 Mar 2005 09:01:07 +0000 (UTC) In-Reply-To: <1137falp86qhk89@corp.supernews.com> User-Agent: G2/0.2 Complaints-To: groups-abuse@google.com Injection-Info: o13g2000cwo.googlegroups.com; posting-host=82.49.51.180; posting-account=Lp02jQ0AAABMd3TAghNf0TM2YBZqD_JE Xref: g2news1.google.com comp.lang.ada:9296 comp.realtime:1411 Date: 2005-03-13T01:01:03-08:00 List-Id: CTips wrote: > Jim Rogers wrote: > > CTips wrote in news:11369p5jrcc6835@corp.supernews.com: > >> [skip] > >>Oh, and just to illustrate another point about Ada, try running the Ada > >>program equivalent to the following program: > > This sort of programming is generally foolishness. > [skip] > This is meant to bring a performance issue into sharp focus. Each > element of this program was picked specifically for that reason. Try > writing the *equivalent* Ada program and *benchmark* it. See what the > performance will be. > [skip] > This is not intended to be a real program; it is meant to illustrate how > much slower Ada can get than C. Try and write it as specified and > measure the resulting performance. Ok, I have compiled and run them both. I think results will interest you, since you are the one who proposed such a comparison. I used GCC-3.4.1 either for compiling your C program and Jim's one. My computer is a single Xeon 450 Mh,1GB RAM Linux-2.6.10. gcc array_c.c -o array_c -O2 -march=pentium2 gnatmake array_ada.adb -O2 -march=pentium2 -gnatp The gcc/gnat "-gnatp" option is just to suppress all checks, that is C default behaviour (seen it doesn't manage run-time exceptions). The following are best times that were computed over 6+6 executions of these two programs. Ada: user 0m11.052s, sys 0m0.005s. C: user 0m13.185s, sys 0m0.008s So, what does it make you think C program is faster than Ada one? Please, compile and run both them by yourself in order to see this evidence. Furthermore I have to say that, with no optimisations, Ada program was a lot faster than C one. Figures are so much ridicoulos that I don't want to show them. I thought that GCC had some kind of problem in compiling that C program, so I wanted to re-compile it. Results didn't change and GCC wasn't somehow able to link the program and it showed the following error every 1 over 6 compilations: array_c: file not recognized: File truncated collect2: ld returned 1 exit status I may expect you don't trust me, so please try yourself. Ciao, fabio de francesco