> Is there some reason that the Java JIT is not doing this, with the > original code using defn, as fast as it works when using defmacro?
The macro expands into bytecode within the same Java method, rather than a method invocation. Some method blocks are too big to inline, and perhaps the JIT doesn't have enough information (or motivation) to do so. The JIT compiler will only inline certain hotspots where it predicts a benefit. Switching to a macro forces the issue by avoiding that runtime analysis altogether. It's also possible that more type propagation, or elimination of boxing (all function parameters are boxed when they cross the function boundary) is involved. I'm sure others will have more to add... --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---