I've found similar things with compiling schema validators. Be careful with doseq benchmarks like this though, if you aren't careful hotspot can completely eliminate parts of the computation as dead code if it can infer the results aren't used. Criterion has a neat trick for making sure this can't happen, IIRC.
On Tuesday, September 17, 2013 10:00:46 AM UTC-7, Jamie Brandon wrote: > > For larger patterns, the staged version is actually significantly faster: > > https://gist.github.com/jamii/6597235 > > On 17 September 2013 16:29, Jamie Brandon > <ja...@scattered-thoughts.net<javascript:>> > wrote: > > I ran a little benchmark comparing different implementations of a toy > > pattern matching protocol: > > > > https://gist.github.com/jamii/6595850 > > > > I'm surprised to find that the staged version is not significantly > > slower than the compiled version. Now I'm wondering whether this is > > feasible on a larger scale. Can I always rely on those fns being > > inlined? Is there some magic threshold on closure nesting where > > suddenly there will be inlining and I will blow up my stack? > > > > More generally, how can I find out this sort of thing? There seems to > > be very little hard information on what optimisations hotspot will > > reliably perform. > > > > This looks like it could be useful - > > > http://mechanical-sympathy.blogspot.co.uk/2013/06/printing-generated-assembly-code-from.html > > > - but I'm not sure how I would make that work with clojures class name > > mangling for closures. > -- -- 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.