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-Thread: f43e6,703c4f68db81387d X-Google-Thread: 108717,a7c8692cac750b5e X-Google-Attributes: gid103376,gid115aec,gidf43e6,gid108717,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!wn13feed!worldnet.att.net!bgtnsc04-news.ops.worldnet.att.net.POSTED!53ab2750!not-for-mail Newsgroups: comp.lang.ada,comp.realtime,comp.software-eng,comp.programming Subject: Re: 10 rules for benchmarking (was Re: Teaching new tricks to an old dog (C++ -->Ada)) From: Jim Rogers References: <4229bad9$0$1019$afc38c87@news.optusnet.com.au> <1110032222.447846.167060@g14g2000cwa.googlegroups.com> <871xau9nlh.fsf@insalien.org> <3SjWd.103128$Vf.3969241@news000.worldonline.dk> <87r7iu85lf.fsf@insalien.org> <1110052142.832650@athnrd02> <1110284070.410136.205090@o13g2000cwo.googlegroups.com> <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> Followup-To: comp.lang.ada,comp.realtime User-Agent: Xnews/5.04.25 Message-ID: Date: Sat, 12 Mar 2005 01:14:24 GMT NNTP-Posting-Host: 12.73.180.145 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc04-news.ops.worldnet.att.net 1110590064 12.73.180.145 (Sat, 12 Mar 2005 01:14:24 GMT) NNTP-Posting-Date: Sat, 12 Mar 2005 01:14:24 GMT Organization: AT&T Worldnet Xref: g2news1.google.com comp.lang.ada:9194 comp.realtime:1329 comp.software-eng:4897 comp.programming:17848 Date: 2005-03-12T01:14:24+00:00 List-Id: CTips wrote in news:11329cb96h2p19f@corp.supernews.com: > > Since it appears that several people out here are making some very > basic mistakes when they report benchmark numbers, I thought I'd write > a small note on how to do benchmarking. > [snip advice] > 10. Make sure that your numbers are reproducible: report > - your times > - your hardware > - your system > * OS (with version) > * compiler (with version) > - the compiler flags used > > Let's see if this helps. I have adjusted my program to meet some of your advice. The I/O at the end is not included in the reported timing. The program now runs for > 1 second. Time run: 1.94 seconds Hardware: 2.0GHz AMD 64 processor with 512 Mb memory System : OS : WIN XP Service Pack 1 compiler: GNAT v3.15p Compiler flags: none (-O2 was tried but appeared to remove too much) Program: Performs bit search 10,000,000 times -- Highest bit set with Ada.Text_Io; with Ada.Calendar; use Ada.Calendar; procedure Highest_Bit_Set is Num : Integer; type Index_Type is mod 32; type Bit_Array is array(Index_Type) of Boolean; pragma Pack(Bit_Array); Overlay : Bit_Array; for Overlay'Address use Num'Address; Start, Stop : Time; Bit_Num : Index_Type := 0; begin Start := Clock; Num := 1; for X in 1..10_000_000 loop for I in reverse Overlay'range loop if Overlay(I) then Bit_Num := I; exit; end if; end loop; end loop; Stop := Clock; Ada.Text_IO.Put_Line("High bit :" & Index_Type'Image(Bit_Num)); Ada.Text_IO.Put_Line("Execution time: " & Duration'Image(Stop - Start)); end Highest_Bit_Set; Program output: High bit : 0 Execution time: 1.950221327 Jim Rogers