> (defn blank? [s] (every? #(Character/isWhitespace %) s))
>
> Have you ever wondered about its performance? Here you go:
>
> user> (time (dotimes [_ 10000] (blank? "                                   
>           ")))
> "Elapsed time: 3887.578 msecs"
>

To give a more complete picture, this version

(defn blank? [s] (every? #(Character/isWhitespace ^char %) s)) 

is only six times slower than the expanded version, and keeping an eye on 
reflection warnings is not such a drag. So, if it could be demonstrated 
that in general the properly type-hinted, but otherwise idiomatic Clojure 
is not more than 10 times slower than idiomatic Java, I'd consider that at 
least a good starting point.

-Marko

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


Reply via email to