Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6676643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:00:57+00:00 2026-05-26T04:00:57+00:00

It seems like when I invoke map on a parallel list, the operation runs

  • 0

It seems like when I invoke map on a parallel list, the operation runs in parallel, but when I do filter on that list, the operation runs strictly sequentially. So to make filter parallel, I first do map to (A,Boolean), then filter those tuples, and map all back again. It feels not very convenient.

So I am interested – which operations on parallel collections are parallelized and which are not?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T04:00:57+00:00Added an answer on May 26, 2026 at 4:00 am

    There are no parallel lists. Calling par on a List converts the List into the default parallel immutable sequence – a ParVector. This conversion proceeds sequentially. Both the filter and the map should then be parallel.

    scala> import scala.collection._
    import scala.collection._
    
    scala> List(1, 2, 3).par.filter { x => println(Thread.currentThread); x > 0 }
    Thread[ForkJoinPool-1-worker-5,5,main]
    Thread[ForkJoinPool-1-worker-3,5,main]
    Thread[ForkJoinPool-1-worker-0,5,main]
    res0: scala.collection.parallel.immutable.ParSeq[Int] = ParVector(1, 2, 3)
    

    Perhaps you’ve concluded that the filter is not parallel, because you’ve measured both the conversion time and the filter time.

    Some operations not parallelized currently: sort* variants, indexOfSlice.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Seems like a simple enough question but I can't seem to find the answer.
Seems like as really simple thing to do, but I just can't track it
Seems like this should be obvious, but how do I send arrow key presses
Seems like this should be simple, but powershell is winning another battle with me.
It seems like calling Invoke on a winforms control in a callback from a
I've heard of soda , but it seems like it requires you to signup
This seems like it should be simple, but maybe I'm missing something. I just
In some C++ code, I am encountering a compile-time error that seems like it
Seems like a simple problem: I have an SVN repo inside our firewall. I
Seems like the subtraction is triggering some kind of issue and the resulting value

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.