comp.lang.ada
 help / color / mirror / Atom feed
* Ada95 speed
@ 1999-05-18  0:00 Clifford J. Nelson
  1999-05-17  0:00 ` David Starner
                   ` (4 more replies)
  0 siblings, 5 replies; 69+ messages in thread
From: Clifford J. Nelson @ 1999-05-18  0:00 UTC (permalink / raw)


Ten years ago a Mandelbrot set computation and display on a 1200x700
screen with eight bit color took six seconds in C on a MacIIfx.

The following computations (leaving out all the with statements that you
need for the Mac) take ten seconds on an iMac 266 MHertz Mac OS 8.5.1
with the CodeBuilder Ada95 GNU from Tenon. I think it should run ten
times faster.

Is Ada95 slow in order to be safe?
Is GNU Ada95 slower than most Adas?
Is the iMac slow? Mac OS 8.5.1 slow?  CodeBuilder?
Why does it take so long?

Program follows--------

with Ada.Numerics.Complex_Types;
use Ada.Numerics.Complex_Types;

procedure Mandel is

-- Initialize procedure goes here for windRect.bottom and windRect.top

procedure Display(Mag : in Float) is
    It : Integer;
    X, Y : Float;
    C, Z : Complex;
    Num_Iters : constant := 64;
    Vertical_Maximum : constant Short_Integer := windRect.bottom;
    Horizontal_Maximum : constant Short_Integer := windRect.Right;
    Ver_Size : constant Float := Float(Vertical_Maximum + 1);
    Hor_Size : constant Float := Float(Horizontal_Maximum + 1);
    StartY : constant Float := -Mag * Ver_Size;
    StartX : constant Float := -Mag * Hor_Size;
    Step : constant Float :=  2.0 * Mag ;

  begin
   Y := StartY;
   for Y_Pos in windRect.top..windrect.bottom - 1 loop
      X := StartX;
      for X_Pos in windRect.left..windRect.right loop
        Z := (X, Y); -- Complex value; standard Ada 95!
        C := Z;
        for I in 0..Num_Iters loop
          It := I;
          exit when (abs( Z)) > 2.0;
          Z := Z * Z + C; -- Complex arithmetic
        end loop;
    -- draw pixel here in color depending on variable It.
    X := X + Step;
    end loop;
   Y := Y + Step;
   end loop;
  end Display;

begin -- Main body of program Mandel
  Initialize;
   Display(0.0025); -- draw the fractal!
  loop
    exit when Events.Button;
  end loop;
end Mandel;





^ permalink raw reply	[flat|nested] 69+ messages in thread
* Re: Ada95 speed
@ 1999-06-07  0:00 Robert I. Eachus
  1999-06-07  0:00 ` tmoran
  0 siblings, 1 reply; 69+ messages in thread
From: Robert I. Eachus @ 1999-06-07  0:00 UTC (permalink / raw)


tmoran@bix.com wrote:

> >In those days, I was as big a fan of APL for the kind of work I was doing
> >as I am of Ada today.
> There is more joy in heaven over one sinner who repents ... ;)

   What?  Do you have something against APL?  For certain jobs it is
still the best language around.  I still use it to prototype
algorithms--even when the final implementation is in Ada.  A few years
ago I spent a few days debugging and tuning an algorithm in APL, then
spent several months documenting, implementing, and tuning in Ada.  I
probably could have spent twice as long doing it all in Ada.  There was
a huge amount of algorithmic design required--the problem involved
solving transportation problems on large sparse matrices.  I ended up
demonstrating that the problem could be solved in milliseconds instead
of hours.

-- 

                                        Robert I. Eachus

with Standard_Disclaimer;
use  Standard_Disclaimer;
function Message (Text: in Clever_Ideas) return Better_Ideas is...




^ permalink raw reply	[flat|nested] 69+ messages in thread
* Re: Ada95 speed
@ 1999-06-06  0:00 tmoran
  1999-06-06  0:00 ` David C. Hoos, Sr.
  0 siblings, 1 reply; 69+ messages in thread
From: tmoran @ 1999-06-06  0:00 UTC (permalink / raw)


> IBM introduced the System 3, Model 6 in the spring of 1971.  It ran
> Basic -- compiled? I don't recall.  It wasn't exactly PC size; it was
> about the size of a desk, with up to 64kb of virtual memory, 16k of real
> memory.
>The 5100 was an 8-bit microcomputer which came out in 1975.  You could get
>a model which ran BASIC or ALP (selectable with a rocker switch).
>It ran Syatem 370 microcode, and cost about $25,000.
  I'm inclined to think 'microcomputer' meant 'built around a
single chip CPU', eg, like the 8080 et al.  If the CPU was a board,
I'd call it a minicomputer.  Granted, the 5100 was small enough
to easily carry, but a lot happened between 1971 and 1975.  By
'75, as I recall, Wang et al were installing minicomputers running
Basic interpreters in lots of small businesses.

> HP ran a time sharing service about the same time that included Basic
> on HP-3000's.
  I recall using Basic over a teletype in the early '60s.  I don't
think it was compiled, however.  Was Basic on the HP-3000 compiled?
If not, what *compiled* Basic was in use by physicists (ie, not just
computer research use) in *1971*?




^ permalink raw reply	[flat|nested] 69+ messages in thread
* Re: Ada95 speed
@ 1999-06-06  0:00 tmoran
  1999-06-06  0:00 ` Robert Dewar
  0 siblings, 1 reply; 69+ messages in thread
From: tmoran @ 1999-06-06  0:00 UTC (permalink / raw)


>several real time operating systems for various microcomputers
>for Honeywell at the time (amazingly some of this equipment is
>still in use at United Airlines counters). These were not
>expensive computers, they cost a couple of thousand dollars.
  Were these machines widely available in 1971, or custom
creations for a few high-volume applications?




^ permalink raw reply	[flat|nested] 69+ messages in thread
* Re: Ada95 speed
@ 1999-06-05  0:00 tmoran
  1999-06-05  0:00 ` Robert Dewar
  0 siblings, 1 reply; 69+ messages in thread
From: tmoran @ 1999-06-05  0:00 UTC (permalink / raw)


>Today's operating systems must manage resource sharing, etc., so
>we're not really comparing like with like here.
  Certainly in 1971 there were plenty of multitasking, resource
sharing, graphic display running, computers around.  Of course
they cost a million bucks but then they also were much less
powerful than a modern Mac or PC.  And given how long it takes
just to *start* a modern editor (or other program), one can be
forgiven for wondering whether there's been much net improvement.




^ permalink raw reply	[flat|nested] 69+ messages in thread
* Re: Ada95 speed
@ 1999-06-05  0:00 tmoran
  1999-06-05  0:00 ` Al Christians
  0 siblings, 1 reply; 69+ messages in thread
From: tmoran @ 1999-06-05  0:00 UTC (permalink / raw)


> I knew physicists in 1971 who wrote programs in compiled basic for
> micro computers.
  What compiled BASIC was that, and what microcomputers (in 1971)?




^ permalink raw reply	[flat|nested] 69+ messages in thread
[parent not found: <374182F2.B10AD449@Maths.UniNe.CH>]

end of thread, other threads:[~1999-06-07  0:00 UTC | newest]

Thread overview: 69+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-05-18  0:00 Ada95 speed Clifford J. Nelson
1999-05-17  0:00 ` David Starner
1999-05-18  0:00   ` Clifford J. Nelson
1999-05-18  0:00 ` Tucker Taft
1999-05-18  0:00   ` Clifford J. Nelson
1999-05-18  0:00 ` Larry Kilgallen
1999-05-18  0:00 ` Florian Weimer
1999-05-20  0:00 ` Tom Moran
1999-05-21  0:00   ` Clifford J. Nelson
1999-05-21  0:00     ` Tom Moran
1999-05-21  0:00       ` Clifford J. Nelson
1999-05-21  0:00         ` Tom Moran
  -- strict thread matches above, loose matches on Subject: below --
1999-06-07  0:00 Robert I. Eachus
1999-06-07  0:00 ` tmoran
1999-06-06  0:00 tmoran
1999-06-06  0:00 ` David C. Hoos, Sr.
1999-06-06  0:00   ` tmoran
1999-06-07  0:00     ` Robert Dewar
1999-06-06  0:00       ` David C. Hoos, Sr.
1999-06-07  0:00         ` Robert Dewar
1999-06-06  0:00       ` Brian Rogoff
1999-06-06  0:00 tmoran
1999-06-06  0:00 ` Robert Dewar
1999-06-05  0:00 tmoran
1999-06-05  0:00 ` Robert Dewar
1999-06-05  0:00   ` Ehud Lamm
1999-06-05  0:00     ` Clifford J. Nelson
1999-06-05  0:00     ` William Starner
1999-06-05  0:00       ` Ehud Lamm
1999-06-06  0:00     ` David Botton
1999-06-06  0:00       ` Ehud Lamm
1999-06-07  0:00         ` Robert Dewar
1999-06-07  0:00           ` Ehud Lamm
1999-06-05  0:00 tmoran
1999-06-05  0:00 ` Al Christians
1999-06-05  0:00   ` David C. Hoos, Sr.
     [not found] <374182F2.B10AD449@Maths.UniNe.CH>
1999-05-18  0:00 ` Tom Moran
1999-05-18  0:00   ` Gautier
1999-05-19  0:00     ` Robert Dewar
1999-05-20  0:00       ` Clifford J. Nelson
1999-05-20  0:00         ` Tucker Taft
1999-05-20  0:00           ` Tom Moran
1999-05-20  0:00             ` Tom Moran
1999-05-21  0:00               ` Tom Moran
1999-05-31  0:00         ` James E. Hopper
1999-06-01  0:00           ` Clifford J. Nelson
1999-06-01  0:00             ` James E. Hopper
1999-06-02  0:00             ` Robert Dewar
1999-06-04  0:00               ` Clifford J. Nelson
1999-06-05  0:00                 ` Robert Dewar
1999-06-01  0:00           ` Clifford J. Nelson
1999-06-01  0:00             ` James E. Hopper
1999-06-02  0:00               ` Clifford J. Nelson
1999-06-04  0:00                 ` Clifford J. Nelson
1999-06-02  0:00             ` James E. Hopper
1999-06-02  0:00               ` Clifford J. Nelson
1999-06-02  0:00                 ` James E. Hopper
1999-06-02  0:00                   ` Clifford J. Nelson
1999-06-02  0:00                     ` John B. Matthews, M.D.
1999-06-02  0:00                       ` Clifford J. Nelson
1999-06-02  0:00                     ` Gautier
1999-06-02  0:00                       ` John B. Matthews, M.D.
1999-06-02  0:00             ` Robert Dewar
1999-06-04  0:00               ` Clifford J. Nelson
1999-06-04  0:00                 ` David C. Hoos, Sr.
1999-06-04  0:00                 ` Ole-Hjalmar Kristensen
1999-06-03  0:00           ` Robert I. Eachus
1999-05-31  0:00       ` Gautier
1999-05-19  0:00   ` Robert Dewar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox