I'm seeing a big difference in speed for each function run only once, so I guess any Hotspot optimization isn't happening right?
But is the way Clojure works so opaque we need to see byte codes? I was hoping someone on the list would have some intuition about how the expressions get implemented. In fact I hope it's pretty close to what I would naively guess from just reading the code as is. So I think gaussian-matrix1 is basically an imperative style program. There's a couple of loops and a random number is generated and then assigned to a element of the 2d array. And I think that gaussian-matrix2 is first generating a nested set lists with all of the random numbers, then each list is copied into a 1d Java array of doubles by the map operation, and then into-array makes a 1d array of double[]'s. Is that about right, or is that too naive somehow? On Sep 19, 2:24 pm, Alessio Stalla <alessiosta...@gmail.com> wrote: > On 19 Set, 19:34, Tim Daly <d...@axiom-developer.org> wrote: > > > In common lisp I use the (disassemble) function which generally > > gives back an assembler listing of the code that would be executed. > > Is there a Java function which will return the byte codes that get > > executed? > > In general there isn't. In the particular situation in which a) the > Lisp implementation controls class loading and b) each Lisp function > is compiled to a distinct Java class, the implementation can arrange > to store the bytecode for each function and run a Java bytecode > decompiler on it to disassemble/decompile it. > > > Could this be used to create a (disassemble) function for > > Clojure? Having such a function means that you don't have to guess > > what the program is actually doing. > > I think Clojure respects point a) and b) above when not using gen- > class to compile multiple functions to a single Java class, so it > would be possible, but it requires support from the implementation, it > cannot be a library function. > > Cheers, > Alessio -- 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