On Jul 3, 4:30 pm, Shawn Hoover <shawn.hoo...@gmail.com> wrote:
> Interesting. Maybe I'm crazy, but when running java -server, replacing
> vectors/assoc with arrays/aset slowed my project down from 4000
> iterations/second to 100! Similarly, removing multimethods for each
> instruction and loop/recur to churn through them and replacing with one big
> fn generated up front resulted in a massive slowdown. I haven't profiled
> yet, but I plan to do so because I'm so surprised by the results.


Well, I did one more thing: implement the VM core in Java. Only the
storage and the instructions. Quite ugly, one class, everything is
public static final, and this thing is fast! I get ~65000 iterations/
s. It would be interesting to find out why

machine_data[pc] = machine_data[r1] + machine_data[r2];

is so much faster than:

(aset-double machine-data (+ (Array/getDouble machine-data r1) (Array/
getDouble machine-data r2)))

but I guess, at this level, it would involve comparing the generated
JVM bytecode for each case but that is way over my capabilities at
this moment.

--
IgorR
--~--~---------~--~----~------------~-------~--~----~
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