title: Detecting Javascript Memory Leaks & Optimizing Code
body: <p>Similar to xdebug+webgrind which gives us the rough time for execution for each function in a file etc, I am wondering how to go about optimizing as well as detecting slow javascript functions. </p>
  
  <p>Am sure firebug can probably do this, but am not sure how? Can someone guide me as to how to detect memory leaks also? How do I decide if a function is too slow? I mean is there any benchmark, for e.g. in PHP i have a rough idea that any script which requires more than 200ms execution time, is kinda slow/maybe can be refactored. Roughly how many seconds should my code execute so that my browser experience is not sluggish? I know its a vague question... but are there any benchmarks?</p>
  
  <p>Is there some kind of steps which I should follow before releasing code for public use?</p>
  
  <p>Thank you very much for your time.</p>