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-03 18:18:47 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!arclight.uoregon.edu!wn13feed!wn12feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!rwcrnsc53.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Ideas for Ada 200X References: X-Newsreader: Tom's custom newsreader Message-ID: NNTP-Posting-Host: 12.234.13.56 X-Complaints-To: abuse@attbi.com X-Trace: rwcrnsc53 1054689526 12.234.13.56 (Wed, 04 Jun 2003 01:18:46 GMT) NNTP-Posting-Date: Wed, 04 Jun 2003 01:18:46 GMT Organization: AT&T Broadband Date: Wed, 04 Jun 2003 01:18:46 GMT Xref: archiver1.google.com comp.lang.ada:38563 Date: 2003-06-04T01:18:46+00:00 List-Id: >I actually did this test in C++ several years ago. The "+=" form was >about three to four times faster. If you're telling me that is not Using subtype ns is integer range 1 .. 100; -- or 1 .. 5 or 1 .. 50 type matrices is array(ns,ns) of integer; procedure add_to(left : in out matrices; right : in matrices) is ... function "+"(left, right : matrices) return matrices is ... and compiling with -O3 -gnato on Windows gnat 3.15p, I find function "+=" takes about 12% longer than procedure add_to inserting "pragma suppress(all_checks)", function "+=" takes about 35% longer than procedure add_to Running a comparison with a program compiled with MSVC++ 5.0 10K iterations on a 100x100 matrix the "+=" vs add_to take 1.17 vs .88 seconds with Ada, 5.3 vs 2.7 seconds with C++ (It's been a while, and my C is rusty. Please ask tmoran@acm.org if you would like my code to check or improve or run with your system.)