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-Thread: a07f3367d7,2c57913d6b8220c1 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!p9g2000vbl.googlegroups.com!not-for-mail From: Martin Newsgroups: comp.lang.ada Subject: Re: Tasking for Mandelbrot program Date: Sun, 27 Sep 2009 22:48:23 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <4abebaf4$0$31342$9b4e6d93@newsspool4.arcor-online.net> <4abfd8df$0$31337$9b4e6d93@newsspool4.arcor-online.net> NNTP-Posting-Host: 86.154.213.155 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1254116903 13293 127.0.0.1 (28 Sep 2009 05:48:23 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 28 Sep 2009 05:48:23 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: p9g2000vbl.googlegroups.com; posting-host=86.154.213.155; posting-account=g4n69woAAACHKbpceNrvOhHWViIbdQ9G User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.0.10, Ant.com Toolbar 1.3,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:8505 Date: 2009-09-27T22:48:23-07:00 List-Id: On Sep 27, 10:27=A0pm, Georg Bauhaus wrote: > Martin wrote: > > On Sep 27, 2:08 am, Georg Bauhaus > bug.bauh...@maps.futureapps.de> wrote: > > [snip] > >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Z2 :=3D (Z.re ** 2, Z.im ** 2); > > [snip] > > > Don't know about the rest of the program but on some platforms I've > > found it to be much faster to replace "** 2" with a straight > > multiplication, e.g. "Z.re * Z.re, Z.im * Z.im". > > I have just checked. =A0The code that gcc is generating looks > the same for ** 2 and for * Z.xx. =A0Irrespective of either > sse instructions or i387 instructions. Well done that compiler! I guess with inlining and decent optimisations a "**" would collapse down to the sensible 'optimal' code. > Some more observations: > > - SSE2 code performs 8% faster when suitable compilation options > =A0 are present, -mfpmath=3Dsse -msse2 (this is currently the case). > =A0 Then digits 15 should probably stay in the declaration of Real. > > - writing the image bytes with Stream_IO removes 6% running time > =A0 when compared to GNAT.IO.Put. > =A0 This adds standard Ada but also adds about 10 lines of code for > =A0 the Put procedure and a Stdout variable. Is it worth it? Yes!!! I'm not sure there much in the way 'bragging rights' to be had from the SLOC count metrics on the shootout - only raw speed is sexy :-) Cheers -- Martin