CuppoJava a écrit : > Hi, > I've noticed that I'm creating a lot of maps of functions, and I'm > wondering if there's a performance penalty for this. > > ie. > (defn create_fn [] > (fn [] (println "hi"))) > > ((create_fn)) <--- Does this "create" a new function every-time it's > called? Or is the function code cached somewhere? How much of a > performance penalty does this incur? > > Thanks for the help >
Last time I ckecked (http://clj-me.blogspot.com/2008/11/surprising.html) it was cheaper to create a closure than a vector or a list. Christophe -- Professional: http://cgrand.net/ (fr) On Clojure: http://clj-me.blogspot.com/ (en) --~--~---------~--~----~------------~-------~--~----~ 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 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 -~----------~----~----~----~------~----~------~--~---