You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it would be nice to have a simple reduceByKey for some collections like this:
str.split("").map(l => (l, 1)).reduceByKey(_+_)
I know there is an easy implementation for reduceByKey as in
[http://stackoverflow.com/questions/15975384/scala-reducebykey-function-use-any-type-that-has-method]
but by adding such a function to collection, we can have a faster implementation for it.
The text was updated successfully, but these errors were encountered:
Muhammad-Ali A'rabi (angellandros) said:
I am implementing a class for paired Traversable type, to add these functions to it.
Anyway, why I can't assign the bloody task to myself?
Muhammad-Ali A'rabi (angellandros) said:
I reimplemented the method, and it's damn fast. On a paired list with 20 entries and 6 different keys, it is 25% faster than Stack Overflow implementation (although, that only works with +), and 4.5x faster than bare-hand implementation of it using a bunch of scala maps and reduces:
I think it would be nice to have a simple reduceByKey for some collections like this:
I know there is an easy implementation for reduceByKey as in
[http://stackoverflow.com/questions/15975384/scala-reducebykey-function-use-any-type-that-has-method]
but by adding such a function to collection, we can have a faster implementation for it.
The text was updated successfully, but these errors were encountered: