Honestly, no. I use Scala pretty much exclusively now for all my various 
jobs, and I write idiomatic Scala using the collections classes very 
heavily, often for some pretty hairy number crunching. So far, performance 
has yet to be a problem on any code that couldn't be better fixed by 
reexamining the algorithms (for example, on a recent task, we got a 10x 
speed up by re-implementing the algorithm from a rather complex tree to a 
binary searchable flat datastructure (actually a vector - a gift from the 
gods in Scala), both used the standard Scala collections, one was just a 
better way to write it than the other). Falling back on Java collections 
has never been necessary for me, and we have had several real world 
benchmarks where idiomatic Scala ran 20-30% faster than some C++ prototype 
code (that was written to be optimal as far as possible). 

I don't doubt that Yammer has some good points, but they have not all been 
consistent with my experience to date. They do mention tail recursion 
instead of for loops as a way of optimising, and I won't say that I 
consciously use that, but I am rather fond of recursion and tend to use it, 
not always because I want or need the performance, but because it makes a 
nice solution. Stick an @tailrec in front of the function, and you mark 
your clear intent to people reading the code, and also ensure that it will 
indeed be tail call optimized. Incidentally, in my example above, the 
binary search did use recursion and was tail call optimized. It was also 
very readable and a natural way to do it.

Another way to look at it is this. We (locus development) deal with very 
large data. Any data access, particularly to a relational DB, is so much 
slower than just about any calculation we do (apart from some of the really 
hairy linear algebra or monte carlo stuff) that it is pretty meaningless to 
worry about optimizing it. Likewise for web or web service stuff. All this, 
and we are a pretty calculation intensive problem domain. I guess I don't 
know what Yammer is doing calculation wise, but based on our experience I 
am amazed that web/IO/database is not dwarfing their other performance 
concerns.

Dick

-- 
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/javaposse/-/iy-OKCzFQgQJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en.

Reply via email to