Why is zipped faster than zip in Scala?
None of the other answers mention the primary reason for the difference in speed, which is that the zipped version avoids 10,000 tuple allocations. As a couple of the other answers do note, the zip version involves an intermediate array, while the zipped version doesn’t, but allocating an array for 10,000 elements isn’t what makes … Read more