title: Python Multiprocessing script runs slower than original
body: <p>I read a lot of threads on StackOverFlow to try to understand why is my multiprocessing not working properly.</p>
  
  <p>I need to get IPs from a file, process them and then write them to a file. My processing involves a lot of search through dictionaries and is the part that is the most time consuming. </p>
  
  <p>To troubleshoot, I made my function sleep for a 1/10 of a second on <strong>both</strong> of my scripts (i.e. the regular script and the multiprocessing one) and when I do, my multiprocessing script actually works 5 times faster. With that, I can conclude that my multiprocessing is actually working.</p>
  
  <p>The following code runs 5x faster (concidering I add the <code>time.sleep(0.1)</code> line on both of my scripts): </p>
  
  <pre><code>from multiprocessing.dummy import Pool
  import time
  
  def main(argv):
      *bunch of code calling processFunction*
  
  def processFunction():
      pool = Pool(10)
      results = pool.map(processIP, ipList)
      print(results)
      pool.close()
      pool.join()
  
  def processIP():
      time.sleep(0.1)
  </code></pre>
  
  <p>The original code involves a <strong>for</strong> loop instead of multiprocessing.
  My problem is that if I remove <code>time.sleep(0.1)</code> (on both of them) my script actually takes 2 or 3 seconds more than the original.
  Do you have any idea why?</p>
  
  <p>Thank you in advance for your help</p>
  
  <p>PS: I know that i'm actually using multithreading. The script is suppose to handle a list of approximately 25k IPs</p>