Tuesday, 20 November 2018

Scala Tuple2Zipped vs IterableLike zip

What's the difference between the two implementations? Is one better than the other.

There is a blog post that says that Tuple2Zipped performances better, but it doesn't provide a reason, and looking at the source code I don't see the difference.



val l1 = List(1,2,3)
val l2 = List(5,6,7)

val v1 = l1 zip l2
val v2 = (l1, l2).zipped

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print ...