title: why this multiprocess program is running slowly than its not concurrent version?
body: <p>I have made a program for adding a list by dividing them in subparts and using multiprocessing in Python. My code is the following:</p>
  
  <pre><code>from concurrent.futures import ProcessPoolExecutor, as_completed
  import random
  import time
  
  def dummyFun(l):
      s=0
      for i in range(0,len(l)):
          s=s+l[i]
      return s
  
  
  def sumaSec(v):
      start=time.time()
      sT=0
      for k in range(0,len(v),10):
          vc=v[k:k+10]
          print ("vector ",vc)
          for item in vc:
              sT=sT+item
          print ("sequential sum result ",sT)
          sT=0
      start1=time.time()
      print ("sequential version time ",start1-start)
  
  
  def main():
      workers=5
      vector=random.sample(range(1,101),100)
      print (vector)
      sumaSec(vector)
      dim=10
      sT=0
      for k in range(0,len(vector),dim):
          vc=vector[k:k+dim]
          print (vc)
          for item in vc:
              sT=sT+item
          print ("sub list result ",sT)
          sT=0
  
      chunks=(vector[k:k+dim] for k in range(0,len(vector),10))
      start=time.time()
      with ProcessPoolExecutor(max_workers=workers) as executor:
          futures=[executor.submit(dummyFun,chunk) for chunk in chunks]
      for future in as_completed(futures):
          print (future.result())
      start1=time.time()
      print (start1-start)
  
  if __name__=="__main__":
      main()
  </code></pre>
  
  <p>The problem is that for the sequential version I got a time of:</p>
  
  <pre><code>0.0009753704071044922
  </code></pre>
  
  <p>while for the concurrent version my time is:</p>
  
  <pre><code>0.10629010200500488
  </code></pre>
  
  <p>and when I reduce the number of workers to 2 my time is:</p>
  
  <pre><code>0.08622884750366211
  </code></pre>
  
  <p>why is this happening?</p>
  
  <p>Thanks</p>