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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,38fc011071df5a27 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-05 01:28:19 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news.teledanmark.no!news.equant.no!uio.no!193.216.69.35.MISMATCH!dax.net!juliett.dax.net!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Ideas for Ada 200X References: <6a90b886.0305262344.1d558079@posting.google.com> <3ED41344.7090105@spam.com> <3ED46D81.FF62C34F@0.0> <3ED46E07.4340CABC@0.0> <3ED4F3FD.A0EF7079@alfred-hilscher.de> <6vWcnTWjF83bD0qjXTWcpA@gbronline.com> <3EDCBDF4.1050900@attbi.com> <3EDEC9A7.9050602@attbi.com> From: Ole-Hjalmar Kristensen Message-ID: <7vy90h2akm.fsf@vlinux.voxelvision.no> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 05 Jun 2003 08:27:37 GMT NNTP-Posting-Host: 193.216.12.150 X-Complaints-To: abuse@tele2.no X-Trace: juliett.dax.net 1054801657 193.216.12.150 (Thu, 05 Jun 2003 10:27:37 MET DST) NNTP-Posting-Date: Thu, 05 Jun 2003 10:27:37 MET DST Organization: Tele2 Norway AS Public Access Xref: archiver1.google.com comp.lang.ada:38665 Date: 2003-06-05T08:27:37+00:00 List-Id: "Robert I. Eachus" writes: > add in place--if that is what you want to do. Appended is an Ada > program that runs eight test cases Integer vs. Float, "+" vs. Add, and > constraint checking on vs. all checks suppressed. As you can see, in > this particular case, suppressing checks is a win for Integer, a lose > for Float. This is fairly typical. (If you compile with GNAT > remember to invoke gnatmake with -gnato, to enable integer constraint > checking. Of course, the program should let you know if you forgot.) > > E:\Ada\Test\New Folder>test_matrix_add > test_matrix_add > Initialize Generators. > Initialize Integer Matricies. > Initialize Float Matrices. > Initialization Completed. > Integer "+" operator, checks on, required 320.349 milliseconds. > Integer Add operator, checks on, required 221.992 milliseconds. > Integer "+" operator, checks off, required 262.464 milliseconds. > Integer Add operator, checks off, required 170.612 milliseconds. > Float "+" operator, checks on, required 222.519 milliseconds. > Float Add operator, checks on, required 150.401 milliseconds. > Float "+" operator, checks off, required 222.297 milliseconds. > Float Add operator, checks off, required 171.129 milliseconds. > All Done. > As you say, it depends on the system whether or not it pays to turn off the checks. Here are the results from my system. For Integer turning off the checks is a win, for Float it does not seem to matter. One other difference: with checks on, the integer "+" is actually slightly faster than add. With checks off, it's 3 times slower. $ gnatmake -s -gnato -O3 -funroll-loops test_matrix_add gcc -c -gnato -O3 -funroll-loops test_matrix_add.adb gnatbind -x test_matrix_add.ali gnatlink test_matrix_add.ali oleh@VOLGA /cygdrive/c/div $ test_matrix_add Initialize Generators. Initialize Integer Matricies. Initialize Float Matrices. Initialization Completed. Integer "+" operator, checks on, required 43.795 milliseconds. Integer Add operator, checks on, required 45.960 milliseconds. Integer "+" operator, checks off, required 23.682 milliseconds. Integer Add operator, checks off, required 8.478 milliseconds. Float "+" operator, checks on, required 22.506 milliseconds. Float Add operator, checks on, required 12.920 milliseconds. Float "+" operator, checks off, required 22.491 milliseconds. Float Add operator, checks off, required 12.988 milliseconds. All Done. -- Ole-Hj. Kristensen ****************************************************************************** * You cannot consistently believe this sentence. ******************************************************************************