On Jan 15, 3:38 am, "Mark H." <mark.hoem...@gmail.com> wrote:
> On Jan 14, 8:27 am, Asbjørn Bjørnstad <asbj...@gmail.com> wrote:
>
> > Anyway, here is a core part of the algorithm. It's a diffusion
> > step, this gets called 3 times and in total this takes up more than
> > one second of cpu time on my machine which makes framerates very
> > slow. If anyone got any improvements I'd be happy to hear about it:
>
> Here are a few possibilities:
>
> 1. Java 2-D, 3-D, etc. arrays are implemented as arrays of (arrays
> of ... pointers), which hurts spatial locality. It was enough of a
> problem that I've seen people reimplement 2-D arrays using 1-D
> arrays. You might consider using a 1-D array and taking the trouble
> to do the indexing by hand. Of course only a benchmark can tell
> whether it really helps.
Look closer, I'm using a 1-D array and indexing by hand :-)
> 3. I noticed you are doing 20 iterations of Gauss-Seidel. There are
> some smart ways to speed up multiple stencil applications. I can
> point you to references if you are interested.
That would be cool. Although, I just copied someone elses algorithm,
and I think he knew what he were doing so it may be hard to improve
on it. (Apart from the unchecked- functions pointed out by Chouser
and Rich.)
--
-asbjxrn
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---