On Oct 1, 2009, at 14:11 , Josh Cheek wrote:

> I generalized yours, and made the returned groups sorted by the  
> results from
> the call. In this more comparable situation, inject is about 11%  
> slower, not
> twice as slow.

This "more comparable" situation is full of bugs and isn't comparable.

Yes, I should have said "your [ilan's] inject version is twice as slow  
as mine" instead of "inject is twice as slow as mine" but my numbers  
still stand. If you use the right tool for the job and it'll pay off  
in both maintainability and speed.

Your version isn't maintainable, has bugs(*) and obfuscates a ton,  
missing my point entirely. Simpler code wins HANDS DOWN. As I said the  
first time: "I think the readability is more important than speed by a  
long shot". FWIW, my results running your code as-is was exactly 2x  
yours (22% slower, not 11% slower).

*) calling sort! within a law of demeter violation is ALWAYS a bug.
*) calling (almost) any bang method on a temporary value is usually a  
bug.