On Tuesday, January 15, 2013 9:35:07 PM UTC+1, Thomas wrote:
>
> I think I just answered my own question...
>
> user=> (time (dotimes [n 20000] (s-blank? "asdf")))
> "Elapsed time: 2481.018 msecs"
> nil
> user=> (time (dotimes [n 20000] (blank? "asdf")))
> "Elapsed time: 14.347 msecs"
> nil
> user=> 
>
> Quite a difference I have to say. 
>

Yes; moreover, I find it misleading and almost a case of false advertising 
when such succint code is demonstrated without so much as a footnote 
mentioning the enormous performance penalty of converting a String into a 
sequence of Characters and then calling a higher-order function on it. The 
proper way to advertise Clojure is this: in Java you have little choice but 
write verbose, performant code; in Clojure you can go both ways and for 
most cases the overhead won't be the main bottleneck. But, at all times, do 
keep in mind the consequences of your choice of idiom.

-- 
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

Reply via email to