Skip to main content
The 2024 Developer Survey results are live! See the results

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • 2
    Don't use List for distributed (par) operations. You should use an IndexedSeq.
    – senia
    Commented Nov 20, 2013 at 10:34
  • @senia - can you just elaborate shortly on why using a list is a bad idea in this case? I do not need the resulting list to be ordered in any way.
    – csvan
    Commented Nov 20, 2013 at 11:18
  • 6
    It's because of the way par method creates parallel collection. For Vector (default IndexedSeq implementation), Range and Array it just wraps initial collection with lightweight wrapper. But for List it should create a completely new collection, it could lead to performance issue. See Creating a Parallel Collection.
    – senia
    Commented Nov 20, 2013 at 11:39
  • For the sake of precision in language, "parallel" and "distributed" really should not be conflated. Commented Nov 20, 2013 at 17:27
  • Right, fixing that. Also, thanks a lot for the clarification @senia
    – csvan
    Commented Nov 20, 2013 at 23:12