title: Python code optimizing with the profile class
body: <p>My code has become really slow after some last changes I have done. A searching task takes 102 seconds instead of 2-3 seconds.</p>
  
  <p>I've tried using the <code>profile</code> class in order to find the limiting function, and here is the output:</p>
  
  <pre><code>&gt;&gt;&gt; import WebParser
  &gt;&gt;&gt;
  &gt;&gt;&gt; w = WebParser.LinksGrabber
  &gt;&gt;&gt;
  &gt;&gt;&gt; import cProfile
  &gt;&gt;&gt; cProfile.run("w.search('nicki minaj', 15)")
           50326 function calls in 102.745 seconds
  
     Ordered by: standard name
  
     ncalls  tottime  percall  cumtime  percall filename:lineno(function)
          1    0.000    0.000  102.745  102.745 &lt;string&gt;:1(&lt;module&gt;)
          6    0.000    0.000    0.000    0.000 Config.py:110(__getattr__)
          1    0.000    0.000  102.745  102.745 LinksGrabber.py:427(search)
          5    0.000    0.000    0.002    0.000 Queue.py:107(put)
        911    0.040    0.000  102.726    0.113 Queue.py:150(get)
         ..................................
        }
       6836    0.022    0.000    0.022    0.000 {min}
        917    0.009    0.000    0.009    0.000 {thread.allocate_lock}
          3    0.000    0.000    0.000    0.000 {thread.get_ident}
          3    0.000    0.000    0.000    0.000 {thread.start_new_thread}
      6835  100.458    0.015  100.458    0.015 {time.sleep}
      11346    0.035    0.000    0.035    0.000 {time.time}
  </code></pre>
  
  <p>It shows that a <code>time.sleep</code> code is waiting for <code>100.458s</code>, but I can't find the code piece in my <code>WebParser.LinksGrabber</code> class.</p>
  
  <p>How can I use <code>profile</code> to get more information about the slow piece of code?</p>