Each iteration contains 266 instructions. So, it is more like 10.5 clock cycle per instructions. Probably the cost of the method call, that I had to introduce in order to have the JIT compile, or the fact that the status register is not directly in a local variable but with an indirection, because we can't set the value of a local variable directly. I could improve that by threading the status reg as a local parameter with let instructions, but that would mean change a lot of things in the code... And I got lazy.
If the program is correct, of which I am not sure yet, it is already quite good as it is quite straightforward and probably far more readable/maintanable than the implementations in other languages. Moreover, Clojure is young and being so close from the best solution would already be great. Actually, that would be so good, that I actually think there is a mistake somewhere either in my program or my computation of the speed. Let's wait for igorrumiha to check and to test this implementation. Best regards, Nicolas. On Sun, Jul 5, 2009 at 12:18 PM, fft1976 <fft1...@gmail.com> wrote: > > On Jul 5, 2:31 am, Nicolas Oury <nicolas.o...@gmail.com> wrote: > > > After, when I run the benchmark in -server with a big enough CacheCode > area > > (1000m), and enough iterations to have everything JITed, I get more than > > 860.000 iterations per second. (I benchmarked 100 000 000 iterations in > 121 > > sec, on my 2.4GHz computer). > > That's 3000 clock cycles per VM instruction? I'm not very familiar > with the problem, but I thought "straight" C bytecode interpreters > were at around 30 and compiling the VM code to native code (with JIT) > reduced it to 7. Is this right? > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---