[Prev][Next][Index][Thread]

Re[2]: Dylan performance



Hello Rolf,

Friday, January 12, 2001, 4:45:02 AM, you wrote:

RW> Hi,

RW> thanks  to  all  for your replys. Unfortunately the program didn't
RW> become faster (actually used code below).

Thanks for your interest in Dylan.

RW> I  switched  to "Production mode", made a "Prodcution Release" and
RW> ran the release executable by double clicking on it. I still takes
RW> 50  seconds.  This  is  the slowest one of all I have tested, even
RW> unoptimized Lisp is faster.

I am sure that our performance will be much better than 50 seconds and
your  program should definitely not stack overflow. We're looking into
it  now and will get back to you shortly. In the meanwhile, here are a
few suggestions:

RW> let t1 = make(limited(<array>, of: <float>), dimensions: #(300, 300), fill: 0.0);
RW> let t2 = make(limited(<array>, of: <float>), dimensions: #(300, 300), fill: 0.0);

use the following instead at top level:

   define constant <float-array> = limited(<array>, of: <single-float>);

RW> //with the above two declarations within the method body I get a "stack overflow error".

RW> define method temp (nx :: <integer>, ny :: <integer>, nt :: <integer>)

 and put the array creation inside the function temp as follows:

   let t1 = make(<float-array>, dimensions: list(nx, ny), fill: 0.0);
   let t2 = make(<float-array>, dimensions: list(nx, ny), fill: 0.0);

RW>    for (k from 0 to nt - 1)
RW>      for (i from 1 to nx - 2)
RW>        for (j from 1 to ny - 2)
RW>            t2[i, j] := t1[i, j] + 1.0 + 0.1 *
RW>                                               (t1[i + 1, j] +
RW>                                                t1[i - 1, j] +
RW>                                                t1[i, j + 1] +
RW>                                                t1[i, j - 1] -
RW>                                          4.0 * t1[i,j]);
RW>         end for;
RW>      end for;
RW>      for (i from 1 to nx - 2)
RW>        for (j from 1 to ny - 2)
RW>            t1[i, j] := t2[i, j] + 1.0 + 0.1 *
RW>                                               (t2[i + 1, j] +
RW>                                                t2[i - 1, j] +
RW>                                                t2[i, j + 1] +
RW>                                                t2[i, j - 1] -
RW>                                          4.0 * t2[i,j]);
RW>         end for;
RW>      end for;
RW>      format-out("%= \n", aref(t1, 150, 150));
RW>    end for;
RW> end method;

RW> temp(300 , 300 , 10);

Jonathan Bachrach, President, Functional Objects, Inc.




Follow-Ups: References: