Yes, the step extract function encodes the total number of steps and any intermediate steps whose values are to be saved.
I did the following changes to the code: 1 - Store results locally in the threads and return them when the thread function exits, instead of using global vector. This does not impact performance directly (tested), but allows to use a transient vector to store the results locally, which is faster. 2 - Use loop/recur to loop over the particles, the steps and the valid displacement generation (instead of lazy sequences with extract function). Also in a few other small loops that are executed many times. 3 - Use transients in any vector to which a lot of data is going to be conjoined during the calculation. These changes brought the following results. There is some improvement, both in computing time and scaling. See graphs attached: The master branch is the old code I posted already and the perftest branch contains the changes. I'm sure there is still room for improvement, and I'll focus on that as soon as some important missing features get implemented and I can finish some calculations that we need urgently. kovasb: Could you elaborate the last part of "I think you should try making the core iteration purely functional, meaning no agents, atoms, *or side effecting functions like the random generator*"? I did remove the atom and agent (I keep a global integer ref though since I need to track the progress of the calculation). Regarding the random displacements, if it means generating them first and then consuming them in a side effect free fashion, it would take a lot of RAM to store all those numbers... Thanks a lot for the help, I'll keep you posted about any other tests that might be interesting and will let you know when the code gets released. Best, Jose. -- -- 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
benchmark.pdf
Description: Adobe PDF document
scaling.pdf
Description: Adobe PDF document