I just found out the reason why it is so slow. Most of the variables were 
global, allocated on the heap.
So I put the program into a function. Now it runs 40 times faster.

Le mercredi 7 octobre 2015 00:40:10 UTC+3, Alain Clo a écrit :
>
> Hello, 
> I am a new user of Julia and I would like to introduce Julia to 
> researchers and students
> in the university.
>
> As to give a try, I translated a fortran code to Julia.
> This code implements the propagation of a 2D acoustic wave using finite 
> differences.
> The code produces good numerical results, 
> and I am using gadfly to display the results (currently commented)
>
> The not so good news is that it is very slow, 100 times slower than 
> fortran.
> It spends most the time in the loops at line 121. I do not know why it is 
> so slow.
> I guess that I must be doing something really wrong. (maybe in the array 
> allocations !)
>
> Can someone take a look at the code and give me some hints.
> Thanks
> Alain
>
>

Reply via email to