On Jul 28, 7:47 pm, Andy Fingerhut <andy_finger...@alum.wustl.edu>
wrote:
> I have added a script that uses the Java version of the benchmark
> programs to generate the large files that were in the distribution
> file I gave a link to earlier, so it is much smaller.  I've also
> published it on github and added a COPYING file that makes the
> licenses more explicit (revised BSD for everything, some copyright by
> me, the rest by the owner of the benchmark web site).  You can get it
> here:
>
> git://github.com/jafingerhut/clojure-benchmarks.git
>
> Again, submissions for new benchmark programs, or improvements to
> existing ones, are welcome.
>
> Thanks,
> Andy
Hi Andy,
I think I may have found a bug in your code.  The calculation for
magnitude is
mag (/ (/ delta-t dist-squared) dist)
In the Java code for n-body it is
double mag = dt / (dSquared * distance);
Which has the nice effect of removing an expensive divide from the
inner loop.  Doing that & manually inlining the functions in advance!
gives me about ~5% faster numbers.
Code is at http://clojure.pastebin.com/m46d57338

Cheers,
Brad
--~--~---------~--~----~------------~-------~--~----~
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
Note that posts from new members are moderated - please be patient with your 
first post.
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to