> Take a look at any of the Common Lisp or Haskell submissions to the 
> Computer Language Benchmarks Game web site, and you will see some programs 
> that are nowhere near what people typically write in those languages, and 
> certainly not what people would write if they weren't concerned with 
> squeezing out the last drop of performance.  Lots of mutable data 
> structures in both, and lots of type declarations in Common Lisp.
>

Can you really get mutability in Haskell? I thought that was impossible; 
hence the notorious State monad.
 

> Then again, even for C and Java programs on that site, people will do some 
> pretty amazing tricks they wouldn't normally do in those languages, either, 
> e.g. performing I/O in parallel with computation, even when it makes the 
> computation code more complex to give the correct answer.
>

Yes, I've already got frustrated with that site several times. For example, 
Scala beats Java by a wide margin on some benchmarks. Turns out it's 
because it uses JNI to solve the problem with the C bignum library. What 
relevance could that have?

For Clojure, I'd recommend doing the same thing I'd recommend in just about 
> any language: write the code that occurs to you first to get it correct. 
>  If it is fast enough for your purposes, whatever those are, you are done. 
>  If not, use a profiler to see where most of the time is spent, and then 
> start working on optimizations in the same language if they are worth your 
> time to do so.  If they get too difficult in the original language, 
> dropping down to a lower-level language (e.g. Java, C, assembler) is often 
> a choice you can make, depending upon your deployment restrictions.
>

The important consideration is, just how many times the idiomatic code is 
slower? In my book it is a worthwhile goal to improve from 100x slower to 
10x slower, even if that outcome still means it's quite a bit slower.

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