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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,bcdac28207102750 X-Google-Attributes: gid103376,public From: Tucker Taft Subject: Re: Ada95 speed Date: 1999/05/20 Message-ID: <3744141A.73D7A4D2@averstar.com>#1/1 X-Deja-AN: 480125119 Content-Transfer-Encoding: 7bit Sender: news@inmet.camb.inmet.com (USENET news) X-Nntp-Posting-Host: houdini.burl.averstar.com References: <374182F2.B10AD449@Maths.UniNe.CH> <3741aa37.3892645@news.pacbell.net> <3741B203.4890880B@Maths.UniNe.CH> <7ht4ss$4mu$1@nnrp1.deja.com> <3743D5BB.37152F94@gte.net> Content-Type: text/plain; charset=us-ascii Organization: AverStar (formerly Intermetrics) Burlington, MA USA Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-05-20T00:00:00+00:00 List-Id: Clifford J. Nelson wrote: > > Here is the program again with all the crazy Mac operating system stuff. > The graphics are one hundred times to slow as far as I'm concerned, and > the other computations are about ten times slower than I expected. The > "computer revolution" has been smashed by performance problems and you > will have to "jump through hoops" and "thread needles" to get the > performance implied by the advertised clock speeds of new computers and > "compiled" languages. > > Sorry, but, I just had to get that off my chest. The emperor has no > clothes. You still have a call on Quickdraw inside your inner loop. You should time the program with the calls on Quickdraw commented out, and then compare the time with the calls uncommented. That way you can separate out the amount of time spent in the computations versus the amount spent inside Quickdraw and friends. My guess is that you will find that almost all of the time is inside Quickdraw and friends. If it turns out that the computation is the slow part, then I would have to believe that the floating point is somehow being simulated, rather than executed by hardware (though on a PowerPC, that doesn't make much sense). > > Cliff Nelson > ... > for I in 0..NumberofColors loop > if (Z.Re * Z.Re + Z.Im * Z.Im) > 4.0 then > ballColor.red := Types.UInt16(Itadjuster * I); > ballColor.green := Types.UInt16(Itadjuster * (I ** 3)); > ballColor.blue := Types.UInt16(Itadjuster * (I ** 2)); > Quickdraw.SetCPixel(Short_Integer(X_Pos), > Short_Integer(Y_Pos), > ballColor'Access); > exit; > end if; > Z := Z * Z + C; -- Complex arithmetic > end loop; > ... -- -Tucker Taft stt@averstar.com http://www.averstar.com/~stt/ Technical Director, Distributed IT Solutions (www.averstar.com/tools) AverStar (formerly Intermetrics, Inc.) Burlington, MA USA