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-04 03:16:20 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!uio.no!ntnu.no!not-for-mail From: Preben Randhol Newsgroups: comp.lang.ada Subject: Re: Ideas for Ada 200X Date: Wed, 4 Jun 2003 10:16:20 +0000 (UTC) Organization: Norwegian university of science and technology Message-ID: References: NNTP-Posting-Host: kiuk0152.chembio.ntnu.no X-Trace: tyfon.itea.ntnu.no 1054721780 2785 129.241.83.78 (4 Jun 2003 10:16:20 GMT) X-Complaints-To: usenet@itea.ntnu.no NNTP-Posting-Date: Wed, 4 Jun 2003 10:16:20 +0000 (UTC) User-Agent: slrn/0.9.7.4 (Linux) Xref: archiver1.google.com comp.lang.ada:38580 Date: 2003-06-04T10:16:20+00:00 List-Id: tmoran@acm.org wrote: >>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 I take it you meant: function "+" takes about 35% longer than procedure add_to. -- Preben Randhol http://www.pvv.org/~randhol/